1
0
mirror of https://github.com/golang/go synced 2024-09-30 09:28:33 -06:00

cmd/go: fix mod_gomodcache and generate_env TestScripts on Plan 9

Adjust these two tests for Plan 9,
which uses $path instead of $PATH,
and $home instead of $HOME.

Fixes #39599

Change-Id: Idba95e07d307e76f0f61acd904905b417c52d43a
Reviewed-on: https://go-review.googlesource.com/c/go/+/237941
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Fazlul Shahriar 2020-06-15 13:04:05 -04:00 committed by Bryan C. Mills
parent 844bf11ecd
commit 9ca2474fd2
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,8 @@
# Install an env command because Windows and plan9 don't have it.
env GOBIN=$WORK/tmp/bin
go install env.go
env PATH=$GOBIN${:}$PATH
[plan9] env path=$GOBIN${:}$path
[!plan9] env PATH=$GOBIN${:}$PATH
# Test generators have access to the environment
go generate ./printenv.go

View File

@ -24,7 +24,8 @@ grep '{"Version":"v1.0.0","Time":"2018-02-14T00:45:20Z"}' $GOPATH/pkg/mod/cache/
# If neither GOMODCACHE or GOPATH are set, GOPATH defaults to the user's $HOME/go, so GOMODCACHE becomes $HOME/go/pkg/mod
[windows] env USERPROFILE=$WORK/home # Ensure USERPROFILE is a valid path (rather than /no-home/ so we don't run into the logic that "uninfers" GOPATH in cmd/go/main.go
[!windows] env HOME=$WORK/home
[plan9] env home=$WORK/home
[!windows] [!plan9] env HOME=$WORK/home
env GOMODCACHE=
env GOPATH=
go env GOMODCACHE