diff options
| author | Russ Cox <rsc@golang.org> | 2026-02-26 12:39:48 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2026-03-08 12:59:06 -0700 |
| commit | b7d1c5887561ee5502b6c04baaa27ead13b63971 (patch) | |
| tree | 572eb913bc1e15f49a19fdc1c3ea5d1787e87b69 /src/cmd/internal/script/scripttest/scripttest.go | |
| parent | 383000da24e9b32dbe3cae4c48cbb233d7c62253 (diff) | |
| download | go-b7d1c5887561ee5502b6c04baaa27ead13b63971.tar.xz | |
cmd/go: disallow go env -w GOROOT=...
The go command determines GOROOT from where the binary is.
It is an error to try to run a go command with a mismatched Go tree.
The only possible use for 'go env -w GOROOT=...' would be if you
copied the go executable to a new place (say, $HOME/bin) and needed
to set the default GOROOT so that it could find its way back home.
Don't do that. Use a symlink or a tiny shell script.
Fixes #77825.
Change-Id: I2b4430c46a9ef35fccb7406ffba3e44b3de191be
Reviewed-on: https://go-review.googlesource.com/c/go/+/749461
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/internal/script/scripttest/scripttest.go')
0 files changed, 0 insertions, 0 deletions
