1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:44:41 -07:00
go/internal/lsp/analysis/simplifyslice
Rebecca Stambler 1fd976651f internal/lsp: make sure that gofmt -s analyses don't modify AST
The code for `gofmt -s` directly modifies the AST, since the ASTs are
not long-lived. Some of this code made it into our analysis
implementations, causing very strange bugs to manifest. Added a
regression test for this specific case.

Fixes golang/go#38267

Change-Id: I235620adcbf2bbc7027c6d83ff2c7fe74729062e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/227299
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-04-06 21:01:14 +00:00
..
testdata/src/a internal/lsp/analysis: add simplify-slice pass from "gofmt -s" 2020-03-26 21:04:57 +00:00
simplifyslice_test.go internal/lsp/analysis: add simplify-slice pass from "gofmt -s" 2020-03-26 21:04:57 +00:00
simplifyslice.go internal/lsp: make sure that gofmt -s analyses don't modify AST 2020-04-06 21:01:14 +00:00