Skip to content

Commit 5dd4d6e

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 74628a8 commit 5dd4d6e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cmd/go/alldocs.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,8 @@
931931
//
932932
// If the environment variable is unset, GOPATH defaults
933933
// to a subdirectory named "go" in the user's home directory
934-
// ($HOME/go on Unix, %USERPROFILE%\go on Windows).
934+
// ($HOME/go on Unix, %USERPROFILE%\go on Windows),
935+
// unless that directory holds a Go distribution.
935936
// Run "go env GOPATH" to see the current GOPATH.
936937
//
937938
// Each directory listed in GOPATH must have a prescribed structure:

src/cmd/go/help.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ On Plan 9, the value is a list.
291291
292292
If the environment variable is unset, GOPATH defaults
293293
to a subdirectory named "go" in the user's home directory
294-
($HOME/go on Unix, %USERPROFILE%\go on Windows).
294+
($HOME/go on Unix, %USERPROFILE%\go on Windows),
295+
unless that directory holds a Go distribution.
295296
Run "go env GOPATH" to see the current GOPATH.
296297
297298
Each directory listed in GOPATH must have a prescribed structure:

0 commit comments

Comments
 (0)