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
Labels
Milestone

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.

@stamblerre stamblerre added the NeedsFix label Nov 20, 2019
@gopherbot gopherbot added this to the Unreleased milestone Nov 20, 2019
@gopherbot gopherbot added the Tools label Nov 20, 2019
@gopherbot

This comment has been minimized.

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

This comment has been minimized.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.