diff options
author | Russ Cox <rsc@golang.org> | 2023-01-14 15:08:49 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2023-01-17 16:11:26 +0000 |
commit | 8409251e105486e25d9ae47568ae221eeec636c9 (patch) | |
tree | aa7ab2e1e4a7be651f3c1ac1b6fa4d5a39587ae0 | |
parent | 66689c7d46fb32eca064c9a1e0b2c9de6d377524 (diff) | |
download | go-git-8409251e105486e25d9ae47568ae221eeec636c9.tar.gz |
cmd/go: document GODEBUG=installgoroot=all
At the moment the only documentation is the release notes,
but everything mentioned in the release notes should have
proper documentation separate from them.
Change-Id: I9885962f6c6d947039b0be59b608385781479271
Reviewed-on: https://go-review.googlesource.com/c/go/+/462196
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
-rw-r--r-- | src/cmd/go/alldocs.go | 10 | ||||
-rw-r--r-- | src/cmd/go/internal/work/build.go | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 4c72ab6d56..84afcab7a0 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -746,9 +746,15 @@ // If module-aware mode is enabled, "go install" runs in the context of the main // module. // -// When module-aware mode is disabled, other packages are installed in the +// When module-aware mode is disabled, non-main packages are installed in the // directory $GOPATH/pkg/$GOOS_$GOARCH. When module-aware mode is enabled, -// other packages are built and cached but not installed. +// non-main packages are built and cached but not installed. +// +// Before Go 1.20, the standard library was installed to +// $GOROOT/pkg/$GOOS_$GOARCH. +// Starting in Go 1.20, the standard library is built and cached but not installed. +// Setting GODEBUG=installgoroot=all restores the use of +// $GOROOT/pkg/$GOOS_$GOARCH. // // For more about the build flags, see 'go help build'. // For more about specifying packages, see 'go help packages'. diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index 27fa090f83..2f2860aeb5 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -590,9 +590,15 @@ variable and the presence of a go.mod file. See 'go help modules' for details. If module-aware mode is enabled, "go install" runs in the context of the main module. -When module-aware mode is disabled, other packages are installed in the +When module-aware mode is disabled, non-main packages are installed in the directory $GOPATH/pkg/$GOOS_$GOARCH. When module-aware mode is enabled, -other packages are built and cached but not installed. +non-main packages are built and cached but not installed. + +Before Go 1.20, the standard library was installed to +$GOROOT/pkg/$GOOS_$GOARCH. +Starting in Go 1.20, the standard library is built and cached but not installed. +Setting GODEBUG=installgoroot=all restores the use of +$GOROOT/pkg/$GOOS_$GOARCH. For more about the build flags, see 'go help build'. For more about specifying packages, see 'go help packages'. |