[gopls-release-branch.0.3] internal/lsp: remove nilness analyzer 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 2ee7536ab1cc60871e8074439b63b1db31579ac0) Reviewed-on: https://go-review.googlesource.com/c/tools/+/219223
diff --git a/gopls/internal/hooks/analysis.go b/gopls/internal/hooks/analysis.go index 8e300f3..629bdc8 100644 --- a/gopls/internal/hooks/analysis.go +++ b/gopls/internal/hooks/analysis.go
@@ -5,7 +5,6 @@ package hooks import ( - "golang.org/x/tools/go/analysis/passes/nilness" "golang.org/x/tools/internal/lsp/source" "honnef.co/go/tools/simple" "honnef.co/go/tools/staticcheck" @@ -27,10 +26,5 @@ for _, a := range stylecheck.Analyzers { options.Analyzers[a.Name] = a } - // Add the nilness analyzer only for users who have enabled staticcheck. - // The assumption here is that a user who has enabled staticcheck will - // be fine with gopls using significantly more memory. nilness requires - // SSA, which makes it expensive. - options.Analyzers[nilness.Analyzer.Name] = nilness.Analyzer } }