]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: if GOPATH and GOROOT are the same, refer to wiki page
authorIan Lance Taylor <iant@golang.org>
Wed, 30 Oct 2024 22:21:33 +0000 (15:21 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 31 Oct 2024 17:19:47 +0000 (17:19 +0000)
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 <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>

src/cmd/go/main.go

index f2e4d890d3d61b74b7c4314b5f3db8cb2c05bffc..d519ad99cf5bc1baeb9997e9d0108e7214b1ba3f 100644 (file)
@@ -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.