From d6fdfc252ee1eb3ac8c78a3125b515f7912611f0 Mon Sep 17 00:00:00 2001 From: Asim Date: Sat, 23 Apr 2016 21:37:26 +0100 Subject: [PATCH] Make it easier to add select filters --- client/options.go | 4 ++-- selector/options.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/options.go b/client/options.go index 28a4e9c4..0ab07aa5 100644 --- a/client/options.go +++ b/client/options.go @@ -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...) } } diff --git a/selector/options.go b/selector/options.go index a9fe796d..47bc81c0 100644 --- a/selector/options.go +++ b/selector/options.go @@ -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...) } }