From ddc82ce45ee1f257caf56c5bd51ebca79a1cfbfb Mon Sep 17 00:00:00 2001 From: witt Date: Thu, 12 May 2022 18:07:12 +0800 Subject: [PATCH] fix: delete redundant type conversion (#1977) --- contrib/config/consul/config.go | 4 ++-- contrib/config/etcd/config.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) 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 {