From: Russ Cox Date: Wed, 30 Nov 2016 22:16:32 +0000 (-0500) Subject: cmd/go: document GOPATH default exception X-Git-Tag: go1.8beta1~5 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5dd4d6edb8c935ce313782ec6ce838c03c73ea9b;p=gostls13.git 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 --- 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: