Make it easier to add select filters

This commit is contained in:
Asim 2016-04-23 21:37:26 +01:00
parent ed764ca0b2
commit d6fdfc252e
2 changed files with 4 additions and 4 deletions

View File

@ -187,9 +187,9 @@ func DialTimeout(d time.Duration) Option {
// Call Options
func WithSelectOption(so selector.SelectOption) CallOption {
func WithSelectOption(so ...selector.SelectOption) CallOption {
return func(o *CallOptions) {
o.SelectOptions = append(o.SelectOptions, so)
o.SelectOptions = append(o.SelectOptions, so...)
}
}

View File

@ -37,8 +37,8 @@ func Registry(r registry.Registry) Option {
// WithFilter adds a filter function to the list of filters
// used during the Select call.
func WithFilter(fn Filter) SelectOption {
func WithFilter(fn ...Filter) SelectOption {
return func(o *SelectOptions) {
o.Filters = append(o.Filters, fn)
o.Filters = append(o.Filters, fn...)
}
}