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

x/tools: fix staticcheck warnings #35718

Open
stamblerre opened this issue Nov 20, 2019 · 2 comments
Open

x/tools: fix staticcheck warnings #35718

stamblerre opened this issue Nov 20, 2019 · 2 comments

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Nov 20, 2019

gopls enabled running diagnostics on an entire workspace, which surfaced > 200 staticcheck warnings in x/tools. We are disabling this behavior in gopls since it caused a real slowdown, but we should still fix all of the staticcheck warnings that we saw.

@gopherbot gopherbot added this to the Unreleased milestone Nov 20, 2019
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 20, 2019

Change https://golang.org/cl/208098 mentions this issue: internal/lsp: don't run analyses on the entire view

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 21, 2019

Change https://golang.org/cl/208257 mentions this issue: all: fix some staticcheck errors

gopherbot pushed a commit to golang/tools that referenced this issue Nov 25, 2019
Running staticcheck on the entire workspace causes a slowdown, and most
likely users don't want to see staticcheck reports for every
subdirectory of their workspace. Only run staticcheck on open files.

Also, fixed a staticcheck warning that showed up along the way. Filed
golang/go#35718 to remind ourselves to fix all of the staticcheck warnings
that showed up when we ran gopls with staticcheck on x/tools.

Finally, made sure that we don't send empty diagnostics when diagnosing
the snapshot on start-up, as that is not necessary.

Change-Id: Ic51d1abfc80b1b53397057f06a4cfd7e2dc930f9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208098
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
gopherbot pushed a commit to golang/tools that referenced this issue Jan 29, 2020
Updates golang/go#35718

Change-Id: I10bfd5421cd44bb58b8bcaa6e9205040c25f51be
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208257
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants