Skip to content

Commit

Permalink
Bucket values is now variadic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Oliver committed Nov 2, 2023
1 parent 9725b69 commit 27c0060
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ func (singleton) Label(key, value string) option {
func (singleton) Exporter(value Exporter) option {
return func(this *configuration) { this.Exporter = value }
}
func (singleton) Bucket(value uint64) option {
func (singleton) Bucket(values ...uint64) option {
return func(this *configuration) {
this.Buckets = append(this.Buckets, value)
this.Buckets = append(this.Buckets, values...)
sort.Slice(this.Buckets, func(i, j int) bool { return this.Buckets[i] < this.Buckets[j] })
}
}

func (singleton) apply(options ...option) option {
return func(this *configuration) {
this.Labels = map[string]string{}
for _, option := range Options.defaults(options...) {
option(this)
for _, item := range Options.defaults(options...) {
item(this)
}
}
}
Expand Down

0 comments on commit 27c0060

Please sign in to comment.