From: Ian Lance Taylor Date: Wed, 30 Oct 2024 22:21:33 +0000 (-0700) Subject: cmd/go: if GOPATH and GOROOT are the same, refer to wiki page X-Git-Tag: go1.24rc1~525 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2bb820fd5be238c73e260011dbe4bd76f5c9313b;p=gostls13.git 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 #65656 Fixes #70093 Change-Id: I555399c52e9b72a7a66f0bd38df178c0efad6c27 Reviewed-on: https://go-review.googlesource.com/c/go/+/623815 Reviewed-by: Sam Thanawalla Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Commit-Queue: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index f2e4d890d3..d519ad99cf 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -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.