diff --git a/contrib/config/consul/config.go b/contrib/config/consul/config.go index afdf91323..f42611e0b 100644 --- a/contrib/config/consul/config.go +++ b/contrib/config/consul/config.go @@ -20,9 +20,9 @@ type options struct { // WithContext with registry context. func WithContext(ctx context.Context) Option { - return Option(func(o *options) { + return func(o *options) { o.ctx = ctx - }) + } } // WithPath is config path diff --git a/contrib/config/etcd/config.go b/contrib/config/etcd/config.go index 854b0a961..37059e10e 100644 --- a/contrib/config/etcd/config.go +++ b/contrib/config/etcd/config.go @@ -19,25 +19,25 @@ type options struct { prefix bool } -// WithContext with registry context. +// WithContext with registry context. func WithContext(ctx context.Context) Option { - return Option(func(o *options) { + return func(o *options) { o.ctx = ctx - }) + } } // WithPath is config path func WithPath(p string) Option { - return Option(func(o *options) { + return func(o *options) { o.path = p - }) + } } // WithPrefix is config prefix func WithPrefix(prefix bool) Option { - return Option(func(o *options) { + return func(o *options) { o.prefix = prefix - }) + } } type source struct {