Skip to content

Staticcheck doesn't display live problems #2067

Answered by hyangah
oussamm asked this question in Help
Discussion options

You must be logged in to vote

We need more details on your setup (i.e. is there a lint error that you expected? did you open the file? what is the code layout?). But if what you want is to run lint for all packages in the workspace, can you try to run "Go: Lint Workspace" (not with gopls's staticcheck, but with the default settings)? Or set "go.lintOnSave": "workspace" and save a file to trigger lint.

I heard gopls does not report lint errors for unopened files/packages - that's too expensive.
In the legacy lint tool mode (not gopls mode), the default linting works on the current 'package'.

Another downside of staticcheck option offered by gopls is currently there is no configuration option.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@oussamm
Comment options

Comment options

You must be logged in to vote
2 replies
@oussamm
Comment options

@hyangah
Comment options

Answer selected by oussamm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants