1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:46:12 -07:00
go/internal/lsp/analysis/simplifyrange
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-range pass from "gofmt -s" 2020-03-26 20:18:45 +00:00
simplifyrange_test.go internal/lsp/analysis: add simplify-range pass from "gofmt -s" 2020-03-26 20:18:45 +00:00
simplifyrange.go internal/lsp: make sure that gofmt -s analyses don't modify AST 2020-04-06 21:01:14 +00:00