-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: add 'unused' analyses from staticcheck #36602
Comments
/cc @ridersofrohan |
Change https://golang.org/cl/222817 mentions this issue: |
https://golang.org/cl/222817 provides an opt in analyzer to detect potentially unused parameters. It still needs some work, specifically:
|
This change adds a pass that checks for unused parameters inside of a function. It is disabled by default. Updates golang/go#36602 Change-Id: I9e8de3368f16f27e7816ec4ddb16935e1a05584e Reviewed-on: https://go-review.googlesource.com/c/tools/+/222817 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Change https://golang.org/cl/374254 mentions this issue: |
Suggest replacing the unused function parameter with _. Updates golang/go#36602 Change-Id: I53738e65907b8a4b4857dd8954f1477a043cf442 Reviewed-on: https://go-review.googlesource.com/c/tools/+/374254 Trust: Suzy Mueller <suzmue@golang.org> Run-TryBot: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Addressing the initial note of this issue:
|
@adonovan should this have been resolved with https://go.dev/cl/639716? I don't think we're going to do anything else within gopls for this issue. Users who want more robust results can run the deadcode command line tool. |
Closing as I think this is done. Please reopen if I'm misunderstanding. |
We don't have https://pkg.go.dev/honnef.co/go/tools/unused?tab=doc analyses in
gopls
because they require whole program evaluation (due to test variants). We should investigate how we can add these analyses.The text was updated successfully, but these errors were encountered: