aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-11-30 17:16:32 -0500
committerRuss Cox <rsc@golang.org>2016-11-30 22:31:18 +0000
commit5dd4d6edb8c935ce313782ec6ce838c03c73ea9b (patch)
tree423ecb4ead8fe65309a7e107e6ab96b44dd7b651
parent74628a8b9f102bddd5078ee426efe0fd57033115 (diff)
downloadgo-5dd4d6edb8c935ce313782ec6ce838c03c73ea9b.tar.gz
go-5dd4d6edb8c935ce313782ec6ce838c03c73ea9b.zip
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 <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/cmd/go/alldocs.go3
-rw-r--r--src/cmd/go/help.go3
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: