diff --git a/client/options.go b/client/options.go index 3536fc9d2..57487c725 100644 --- a/client/options.go +++ b/client/options.go @@ -531,9 +531,9 @@ func (cliOpts *ClientOptions) init(opts ...ClientOption) error { type ClientOption func(*ClientOptions) -func WithClientCheck() ClientOption { +func WithClientNoCheck() ClientOption { return func(opts *ClientOptions) { - opts.Consumer.Check = true + opts.Consumer.Check = false } } diff --git a/client/options_test.go b/client/options_test.go index c2edacc03..66d7d9d0d 100644 --- a/client/options_test.go +++ b/client/options_test.go @@ -70,11 +70,11 @@ func TestWithClientCheck(t *testing.T) { { desc: "config check", opts: []ClientOption{ - WithClientCheck(), + WithClientNoCheck(), }, verify: func(t *testing.T, cli *Client, err error) { assert.Nil(t, err) - assert.Equal(t, true, cli.cliOpts.Consumer.Check) + assert.Equal(t, false, cli.cliOpts.Consumer.Check) }, }, } diff --git a/dubbo.go b/dubbo.go index ea9739b81..3c9bc211e 100644 --- a/dubbo.go +++ b/dubbo.go @@ -78,8 +78,8 @@ func (ins *Instance) NewClient(opts ...client.ClientOption) (*client.Client, err otelCfg := ins.insOpts.CloneOtel() if conCfg != nil { - if conCfg.Check { - cliOpts = append(cliOpts, client.WithClientCheck()) + if !conCfg.Check { + cliOpts = append(cliOpts, client.WithClientNoCheck()) } // these options come from Consumer and Root. // for dubbo-go developers, referring config/ConsumerConfig.Init and config/ReferenceConfig