diff options
author | Bryan C. Mills <bcmills@google.com> | 2019-03-12 14:43:22 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2019-03-12 18:58:04 +0000 |
commit | 334e7509179ba5ca2271ee028052dc1d34b21bcf (patch) | |
tree | 594cac44302aa89a82a09339206782c72ee2594d /src/cmd/cover | |
parent | 49448badb6367835b43aeb9cda3af44ff191bda7 (diff) | |
download | go-334e7509179ba5ca2271ee028052dc1d34b21bcf.tar.gz go-334e7509179ba5ca2271ee028052dc1d34b21bcf.zip |
cmd: ensure that GOPATH is always valid in subprocesses that execute 'go build'
GOPATH/pkg contains, among other things, the module cache (and associated lockfiles).
Fixes #30776
Change-Id: I305cb3c0daab8cedd2e6ad235d4733f66af18723
Reviewed-on: https://go-review.googlesource.com/c/go/+/167082
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/cover')
-rw-r--r-- | src/cmd/cover/cover_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index f002442b63..cf8f3d2384 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -82,6 +82,7 @@ func TestMain(m *testing.M) { fmt.Fprintln(os.Stderr, err) os.Exit(1) } + os.Setenv("GOPATH", filepath.Join(dir, "_gopath")) testTempDir = dir |