Open kpitt opened 4 days ago
parameters-are-used
is an experimental, unsupported option. The only valid use of unused
currently is as used by staticcheck
.
That said, this one might be easy enough to fix.
That said, this one might be easy enough to fix.
I already took a look at the code before filing an issue, and it seems pretty straight-forward. I can submit a pull request if you'd like.
That said, this one might be easy enough to fix.
I already took a look at the code before filing an issue, and it seems pretty straight-forward. I can submit a pull request if you'd like.
Thank you, but I'm significantly faster at making changes than reviewing and merging PRs.
I'm significantly faster at making changes than reviewing and merging PRs.
:+1: I thought that might be the case, but figured I would offer anyway. Just trying to be a good open-source citizen. :grin:
When declaring an interface method, providing names for the parameters can act as a form of documentation, and is necessary if you want to refer to a parameter in the doc comments. However, it is not possible for the parameter to be "used" because an interface method declaration has no body, so these parameters should not be marked as unused even if the
ParametersAreUsed
option is false. I did not see this issue in earlier versions, so it may be a new behavior since the AST-based rewrite.Note that I am running this through
golangci-lint
because I couldn't figure out a way to configure theParametersAreUsed
option when callingstaticcheck
directly. The version ofgolangci-lint
I am using has a dependency on thehonnef.co/go/tools v0.4.7
module.Lint Command Output
Test Code
main.go
Source Codegolangci-list
ConfigEnvironment Info