You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched through the documentation and this is the closest I found to possibly what I'm looking for (#1475). It seems this analyzer is part of staticcheck by default and on so maybe it doesn't work for my use case.
Any suggestions or something I've missed to allow me to catch these unused function parameters with staticcheck?
go version: 1.21.3
gopls version: v0.15.1
staticcheck version: 2023.1.7
The text was updated successfully, but these errors were encountered:
and add a call like cmd.AddBareAnalyzers(unusedparams.Analyzer)
Unfortunately, the second option isn't as viable, because the unusedparams analyzer is an internal package and cannot be imported. The first option, on the other hand, is trivial, since you could just use go run golang.org/x/tools/gopls/internal/analysis/unusedparams/cmd@latest ./....
Currently, gopls is catching unused parameters in functions. I want to enforce this in staticcheck as well as that is part of our CI. Running staticcheck does not catch anything on the same code that gopls catches
unusedparams
(https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/unusedparams#unusedparam)I searched through the documentation and this is the closest I found to possibly what I'm looking for (#1475). It seems this analyzer is part of staticcheck by default and on so maybe it doesn't work for my use case.
Any suggestions or something I've missed to allow me to catch these unused function parameters with staticcheck?
go version: 1.21.3
gopls version: v0.15.1
staticcheck version: 2023.1.7
The text was updated successfully, but these errors were encountered: