mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
If GOROOT is unset (as is common now), then the output of "go env GOROOT" may differ from the GOROOT inferred by alternate compilers being executed and also from the value of runtime.GOROOT() inside compilebench, used by go/build. Harmonize all of these by setting GOROOT explicitly (will fix subcommands) and by invoking the go command to learn about packages instead of assuming go/build has any idea what it's doing. Change-Id: If97aa76cc2afec11a8404975f39329db7eb452e0 Reviewed-on: https://go-review.googlesource.com/109516 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com>