From 5dd4d6edb8c935ce313782ec6ce838c03c73ea9b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Nov 2016 17:16:32 -0500 Subject: [PATCH] cmd/go: document GOPATH default exception Doesn't get defaulted if $HOME/go is a GOROOT. Change-Id: I6ac8211a74029e4ad70a50f6e7884a039a27ab05 Reviewed-on: https://go-review.googlesource.com/33720 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/go/alldocs.go | 3 ++- src/cmd/go/help.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 0272e185ab..b4807420b0 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -931,7 +931,8 @@ // // If the environment variable is unset, GOPATH defaults // to a subdirectory named "go" in the user's home directory -// ($HOME/go on Unix, %USERPROFILE%\go on Windows). +// ($HOME/go on Unix, %USERPROFILE%\go on Windows), +// unless that directory holds a Go distribution. // Run "go env GOPATH" to see the current GOPATH. // // Each directory listed in GOPATH must have a prescribed structure: diff --git a/src/cmd/go/help.go b/src/cmd/go/help.go index 183b27e7e6..fb69d8ec54 100644 --- a/src/cmd/go/help.go +++ b/src/cmd/go/help.go @@ -291,7 +291,8 @@ On Plan 9, the value is a list. If the environment variable is unset, GOPATH defaults to a subdirectory named "go" in the user's home directory -($HOME/go on Unix, %USERPROFILE%\go on Windows). +($HOME/go on Unix, %USERPROFILE%\go on Windows), +unless that directory holds a Go distribution. Run "go env GOPATH" to see the current GOPATH. Each directory listed in GOPATH must have a prescribed structure: -- 2.50.0