-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/tools/gopls: How to disable error message DuplicateDecl on vscode? #68752
Comments
I find a hack to temporarily disable them. https://code.visualstudio.com/updates/v1_85#_hide-problem-decorations But unfortunately this setting will disable all errors, so it seems not to be a good solution. So it will be nice if there is an official way like c/c++ extension. |
I believe this is working as intended, you can't go build a package containing multiple main declarations either. |
go seems to allow user to run a single go file by I know it's not suitable for actual project. But if I am learning go, this will make sense. So, it's not a bug on gopls. It's an advice about flexibility that allows user control specific error message appears or not. Howerver, if you believe this feature will do harm to the code quality in average, I will agree with you. |
Related #41206 |
According to this issue, I should add comment like I add |
gopls version
v0.16.1
go env
What did you do?
"go.useLanguageServer": true
in vscode settings.jsonWhat did you see happen?
many error messages of "main redeclared in this block (see details) compiler(DuplicateDecl)"
What did you expect to see?
Try to find a way to disable those error messages since I know they are not errors for me
Reason
I am doing MIT 6.824 lab
This lab runs application by
So in src/main, many files contain
package main
andfunc main
It is terrible when using vscode to edit which has many red underlines.
So I wonder if there has a way like c language extension to disable specific error messages.
I have searched the doc of analyzers but nothing works to me.
The text was updated successfully, but these errors were encountered: