From 2bb820fd5be238c73e260011dbe4bd76f5c9313b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 30 Oct 2024 15:21:33 -0700 Subject: [PATCH] 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 --- src/cmd/go/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- 2.48.1