From 2ee7536ab1cc60871e8074439b63b1db31579ac0 Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Wed, 12 Feb 2020 15:31:25 -0500 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- gopls/internal/hooks/analysis.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gopls/internal/hooks/analysis.go b/gopls/internal/hooks/analysis.go index 8e300f3991..629bdc8669 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 @@ func updateAnalyzers(options *source.Options) { 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 } }