Skip to content

Commit

Permalink
cmd/go: if GOPATH and GOROOT are the same, refer to wiki page
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Oct 31, 2024
1 parent 5dbb0a5 commit 2bb820f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2bb820f

Please sign in to comment.