go/go
Heschi Kreinick b894a3290f all: use explicit -mod, -modfile fields for gocommand.Invocation
Build flags, -mod, and -modfile are all accepted by disjoint go command
verbs. Mixing them together had the effect of forcing gocommand users to
figure out which went where themselves, which was annoying and
error-prone. Add ModFlag and ModFile fields to Invocation and update all
uses to use them.

go/packages has a BuildFlags field that's bad for the same reason. Add
private modFlag and modFile fields that forward to the corresponding
Invocation fields.

imports.ProcessEnv gets the same treatment.

Fixes golang/go#41826.

Change-Id: If74d19146e9e62930d7c34f40859c27c25566c4e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/263213
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-10-19 17:57:15 +00:00
..
analysis x/tools/go/analysis/passes/unsafeptr: report Header misuse 2020-10-16 18:50:37 +00:00
ast go/ast/inspector: impose maximum capacity 2020-04-10 18:16:43 +00:00
buildutil all: fix more typos 2019-09-11 15:13:14 +00:00
callgraph all: add a space before +build in build tag comments 2019-09-08 12:23:18 +00:00
cfg all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
expect all: update dependencies in go.mod file 2020-07-06 23:19:48 +00:00
gccgoexportdata go/gccgoexportdata: correctly handle archive files containing string tables 2016-11-09 21:28:38 +00:00
gcexportdata Revert "go/internal/gcimporter: remove support for binary export data" 2020-05-26 20:26:39 +00:00
internal all: use explicit -mod, -modfile fields for gocommand.Invocation 2020-10-19 17:57:15 +00:00
loader go/loader: delete example_test.go 2020-10-13 17:43:08 +00:00
packages all: use explicit -mod, -modfile fields for gocommand.Invocation 2020-10-19 17:57:15 +00:00
pointer all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
ssa go/ssa: implement missing testing.testDeps SetPanicOnExit0 method 2020-09-02 15:16:23 +00:00
types go/types/objectpath: cache result of call to scope.Names 2020-05-05 02:31:15 +00:00
vcs go/vcs: ignore "mod" VCS type 2019-05-06 14:53:03 +00:00