1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00
go/cmd
Heschi Kreinick 416e8f4faf internal/imports: require valid options, move LocalPrefix up
CL 239754 eagerly initialized the environment. This turns out to be a
problem for gopls, which calls ApplyFixes with no ProcessEnv.
Reinitializing it every time seriously harmed the performance of
unimported completions. Move back to lazy initialization.

Working with invalid options has caused a lot of confusion; this is only
the most recent. We have to maintain backwards compatibility in the
externally visible API, but everywhere else we can require fully
populated options. That includes the source byte slice and the options.

LocalPrefix is really more of an Option than an attribute of the
ProcessEnv, and it is needed in ApplyFixes where we really don't want to
have to pass a ProcessEnv. Move it up to Options.

Change-Id: Ib9466c375a640a521721da4587091bf93bbdaa3c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/241159
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-07-07 20:02:13 +00:00
..
auth cmd/auth/cookieauth: add a GOAUTH implementation that reads from a cookiefile 2019-04-05 18:06:40 +00:00
benchcmp cmd/benchcmp: add deprecation notice 2020-02-10 18:42:41 +00:00
bundle cmd/bundle: add -tags flag 2019-11-04 19:56:21 +00:00
callgraph all: skip tests if required tools are not found 2019-08-30 15:40:57 +00:00
compilebench cmd/compilebench: report rss measurement 2020-03-18 03:17:18 +00:00
cover cmd/cover: more clearly mark as deprecated 2020-05-22 20:15:01 +00:00
digraph all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
eg cmd/eg: Gofmt eg's dry-run output. 2017-07-13 04:09:46 +00:00
fiximports all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
getgo all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
go-contrib-init cmd/go-contrib-init: add unit test for the cmdErr function 2019-11-11 20:03:10 +00:00
godex all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
godoc cmd/godoc: support automatic vendoring 2020-06-09 06:04:08 +00:00
goimports internal/imports: require valid options, move LocalPrefix up 2020-07-07 20:02:13 +00:00
gomvpkg cmd/gomvpkg: add missing closing double-quote to documentation 2018-05-22 18:16:25 +00:00
gorename all: consolidate cgo requirement checks 2020-05-18 17:24:58 +00:00
gotype all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
goyacc cmd/goyacc: print newlines more consistently 2020-07-06 23:41:17 +00:00
guru all: do not write to testdata directories 2019-08-30 17:05:20 +00:00
html2article x/tools/cmd/html2article: remove unused functions 2017-03-01 14:53:04 +00:00
present all: run prettier on js and css 2020-05-28 15:31:44 +00:00
present2md present2md: fix depth count for blogs with sections 2020-03-17 20:55:21 +00:00
splitdwarf all: run go generate 2020-03-11 22:20:14 +00:00
ssadump go/ssa/ssautil: add AllPackages method 2018-10-15 18:41:29 +00:00
stress cmd/stress: use an ellipsis when truncating output 2020-01-22 22:00:14 +00:00
stringer cmd/stringer: remove redundant check in generated code 2020-01-14 01:55:19 +00:00
toolstash cmd/toolstash: don't try comparing "asm -V=full" output. 2017-11-02 22:54:56 +00:00