Skip to content

Commit 2ee7536

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
1 parent 6dd6151 commit 2ee7536

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

gopls/internal/hooks/analysis.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package hooks
66

77
import (
8-
"golang.org/x/tools/go/analysis/passes/nilness"
98
"golang.org/x/tools/internal/lsp/source"
109
"honnef.co/go/tools/simple"
1110
"honnef.co/go/tools/staticcheck"
@@ -27,10 +26,5 @@ func updateAnalyzers(options *source.Options) {
2726
for _, a := range stylecheck.Analyzers {
2827
options.Analyzers[a.Name] = a
2928
}
30-
// Add the nilness analyzer only for users who have enabled staticcheck.
31-
// The assumption here is that a user who has enabled staticcheck will
32-
// be fine with gopls using significantly more memory. nilness requires
33-
// SSA, which makes it expensive.
34-
options.Analyzers[nilness.Analyzer.Name] = nilness.Analyzer
3529
}
3630
}

0 commit comments

Comments
 (0)