Skip to content

Commit

Permalink
since Consumer.Check default value is true, change method to WithClie…
Browse files Browse the repository at this point in the history
…ntNoCheck with Consumer.Check set to false
  • Loading branch information
FoghostCn committed May 18, 2024
1 parent 955c6d6 commit c60423c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c60423c

Please sign in to comment.