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

Fix unusedparams warnings #181

Merged
merged 1 commit into from
May 24, 2023
Merged

Fix unusedparams warnings #181

merged 1 commit into from
May 24, 2023

Conversation

whuwxl
Copy link
Contributor

@whuwxl whuwxl commented May 19, 2023

No description provided.

@sonarcloud
Copy link

sonarcloud bot commented May 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@xy-peng xy-peng requested review from EmmetZC and xy-peng May 22, 2023 07:19
@EmmetZC
Copy link
Contributor

EmmetZC commented May 22, 2023

@whuwxl 请问是什么工具在这里报告了unused parameter

这里的场景是要按声明初始化一个函数,我们所使用的各种Lint和静态检查工具都没有对这里做提示。

@whuwxl
Copy link
Contributor Author

whuwxl commented May 22, 2023

@EmmetZC 我是在用VS Code Insider版本的时候出现了这个提示,VS Code正式版确实没有这个问题。进一步对比发现,应该是Insider版本默认启用了gopls的unusedparams检测。正式版可以使用如下配置开启:

"gopls": {
    "ui.diagnostic.analyses": {
        "unusedparams": true
    }
}

@EmmetZC
Copy link
Contributor

EmmetZC commented May 22, 2023

我查看了gopls的analyser文档,按它的说法,测试文件中的应该会被忽略才对。

image

@EmmetZC
Copy link
Contributor

EmmetZC commented May 22, 2023

我先通过吧,后面再研究一下

@xy-peng xy-peng merged commit a2cc997 into wechatpay-apiv3:main May 24, 2023
21 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.

None yet

3 participants