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

staticcheck isn't installed and it seems to not working when I install it #220

Open
metal3d opened this issue Apr 4, 2024 · 1 comment

Comments

@metal3d
Copy link

metal3d commented Apr 4, 2024

Hi, at first: Thanks!

I've got something weird (didn't tried on my Fedora system, only on the WSL2), it seems that coc-go doesn't install staticcheck tool.

And if I install it myself with: go install honnef.co/go/tools/cmd/staticcheck@latest the tool is in my PATH but it is never used by coc-go.

My gopls config is here:

"go.goplsOptions": {
    "usePlaceholders": true,
    "staticcheck": true,
    "hoverKind": "FullDocumentation"
  },

GoPLS works it seems, but staticcheck doesn't complain about a function that is never used for example.

Any help ?

Note: I also tried to copy the staticcheck binary to the coc-go bin folder:

ls ~/.config/coc/extensions/coc-go-data/bin/
gomodifytags  goplay  gopls  gotests  impl  staticcheck

this doesn't change anything.

@metal3d
Copy link
Author

metal3d commented Apr 4, 2024

Tested on Fedora now.

OK, it seems to work for STxxx problems, but not for Uxxx checks.

On command line:

staticcheck ./...
generator/volume.go:121:6: func valueOrDefault is unused (U1000)
update/main.go:60:19: error strings should not be capitalized (ST1005)
update/main.go:65:19: error strings should not be capitalized (ST1005)
update/main.go:72:19: error strings should not be capitalized (ST1005)
update/main.go:120:10: error strings should not be capitalized (ST1005)

As you can see, it is only OK for update/main.go checks:
image

But on generator/volume.go, no checks explain that the function is unused:

image

Is there a configuration that I missed?

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

No branches or pull requests

1 participant