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/gopls: support non-vet analyses #36639

Closed
sysulq opened this issue Jan 19, 2020 · 6 comments
Closed

x/tools/gopls: support non-vet analyses #36639

sysulq opened this issue Jan 19, 2020 · 6 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@sysulq
Copy link

sysulq commented Jan 19, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13 windows/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\liqi\AppData\Local\go-build
set GOENV=C:\Users\liqi\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=git.dz11.com
set GONOSUMDB=git.dz11.com
set GOOS=windows
set GOPATH=F:\gopath
set GOPRIVATE=git.dz11.com
set GOPROXY=https://mirrors.aliyun.com/goproxy/
set GOROOT=C:\Go
set GOSUMDB=off
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=F:\gopath\src\dubbo-samples\golang\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\liqi\AppData\Local\Temp\go-build457304122=/tmp/go-build -gno-record-gcc-switches

What did you do?

What did you expect to see?

just like https://github.com/golang/tools/tree/master/go/analysis/passes/nilness
support nilness detection for code analysis

What did you see instead?

@gopherbot gopherbot added this to the Unreleased milestone Jan 19, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jan 19, 2020
@stamblerre stamblerre changed the title x/tools/gopls: support nilness detection feature x/tools/gopls: support non-vet analyses Jan 21, 2020
@golang golang deleted a comment from gopherbot Jan 21, 2020
@stamblerre
Copy link
Contributor

Thanks for raising this issue! I think we can expand its scope to include all of the analyses in https://github.com/golang/tools/tree/master/go/analysis/passes.

@ianthehat, @matloob: Is there any reason we haven't added them before / any reason to exclude them?

@stamblerre stamblerre modified the milestones: Unreleased, gopls unplanned Jan 21, 2020
@matloob
Copy link
Contributor

matloob commented Jan 21, 2020

I don't know what the reason was that we hadn't added them before, but my guess was that we started conservative when we added the initial set, and just neglected to add others when we expanded the set of analyses we used to include non-vet analyses.

@gopherbot
Copy link

Change https://golang.org/cl/215677 mentions this issue: internal/lsp/source: add nilness analyzer to LSP's default suite

gopherbot pushed a commit to golang/tools that referenced this issue Jan 27, 2020
…uite

The LSP already supports a bunch of analyses we have less confidence in
than the vet suite so we should add these too.

Updates golang/go#36639

Change-Id: Ifc37d09e3acd73de021be7b45b3d80fe8c00e0d7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/215677
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@stamblerre
Copy link
Contributor

Closing this issue as we've added nilness, deepequalerrors, errorsas, and testinggoroutine.

@gopherbot
Copy link

Change https://golang.org/cl/219203 mentions this issue: internal/lsp: remove nilness analyzer

gopherbot pushed a commit to golang/tools that referenced this issue Feb 12, 2020
The nilness analyzer requires SSA, which is very expensive to build and
uses a lot of RAM. It also seems to really shoot up memory usage when it
hits certain cases, which is causing a lot of problems for users.
Disable this analysis - we'll leave SSA to staticcheck.

Updates golang/go#36639

Change-Id: I46e67a6fd7828a5fddcd42d1aa00876f17c79e3d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/219203
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/219223 mentions this issue: [gopls-release-branch.0.3] internal/lsp: remove nilness analyzer

gopherbot pushed a commit to golang/tools that referenced this issue Feb 12, 2020
The nilness analyzer requires SSA, which is very expensive to build and
uses a lot of RAM. It also seems to really shoot up memory usage when it
hits certain cases, which is causing a lot of problems for users.
Disable this analysis - we'll leave SSA to staticcheck.

Updates golang/go#36639

Change-Id: I46e67a6fd7828a5fddcd42d1aa00876f17c79e3d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/219203
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
(cherry picked from commit 2ee7536)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/219223
@golang golang locked and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants