Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change method WithClientCheck to WithClientNoCheck #2680

Merged
merged 1 commit into from
May 20, 2024

Conversation

FoghostCn
Copy link
Contributor

resolve #2652

since Consumer.Check default value is true, change method WithClientCheck to WithClientNoCheck with Consumer.Check set to false

@FoghostCn FoghostCn requested a review from chickenlj May 18, 2024 09:33
@@ -531,9 +531,9 @@ func (cliOpts *ClientOptions) init(opts ...ClientOption) error {

type ClientOption func(*ClientOptions)

func WithClientCheck() ClientOption {
func WithClientNoCheck() ClientOption {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与其改名字,还不如传一个 check bool 参数进来

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这套 options 的 api 整体风格差不多就是枚举配置项,传参有点风格不一致

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这套 options 的 api 整体风格差不多就是枚举配置项,传参有点风格不一致

这个接口改动后,关键是会影响外部用户使用,所以我还是建议不要改名字,可以在注释上把函数的含义解释清楚。对外接口,不要轻易改动。

OR

把这个函数标记为 deprecated,重新实现一个新函数 WithClientNoCheck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是这样的雨哥,这个 API 目前只发布了一个 rc 版本,使用的人非常少,API 还处于一个不太稳定的状态,而且其实 withCheck 方法用不到,因为默认值就是 true, withCheck 也是设置为true,所以我觉得留着没啥意义

Copy link

sonarcloud bot commented May 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@AlexStocks AlexStocks merged commit 136b058 into apache:main May 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

client.WithClientCheck() should set check to false instead of true.
2 participants