0
1
mirror of https://github.com/golang/go synced 2025-05-24 14:55:02 +00:00

cmd/go: if GOPATH and GOROOT are the same, refer to wiki page

This gives us a place to clarify what the problem is
and how people should fix it.

For 
Fixes 

Change-Id: I555399c52e9b72a7a66f0bd38df178c0efad6c27
Reviewed-on: https://go-review.googlesource.com/c/go/+/623815
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Ian Lance Taylor
2024-10-30 15:21:33 -07:00
committed by Gopher Robot
parent 5dbb0a5c6b
commit 2bb820fd5b

@ -151,7 +151,7 @@ func main() {
// This setting is equivalent to not setting GOPATH at all,
// which is not what most people want when they do it.
if gopath := cfg.BuildContext.GOPATH; filepath.Clean(gopath) == filepath.Clean(cfg.GOROOT) {
fmt.Fprintf(os.Stderr, "warning: GOPATH set to GOROOT (%s) has no effect\n", gopath)
fmt.Fprintf(os.Stderr, "warning: both GOPATH and GOROOT are the same directory (%s); see https://go.dev/wiki/InstallTroubleshooting\n", gopath)
} else {
for _, p := range filepath.SplitList(gopath) {
// Some GOPATHs have empty directory elements - ignore them.