cmd/go: document install outputs to $GOOS_$GOARCH when cross compiling

Fixes #74979

Change-Id: I2a93e3a78c953418cf62d93db107b9c8d25e8ed2
Reviewed-on: https://go-review.googlesource.com/c/go/+/696755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
This commit is contained in:
Sean Liao 2025-08-17 12:46:13 +01:00
parent ffa882059c
commit 119546ea4f
2 changed files with 4 additions and 0 deletions

View file

@ -758,6 +758,8 @@
// variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH // variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH
// environment variable is not set. Executables in $GOROOT // environment variable is not set. Executables in $GOROOT
// are installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN. // are installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN.
// Cross compiled binaries are installed in $GOOS_$GOARCH subdirectories
// of the above.
// //
// If the arguments have version suffixes (like @latest or @v1.0.0), "go install" // If the arguments have version suffixes (like @latest or @v1.0.0), "go install"
// builds packages in module-aware mode, ignoring the go.mod file in the current // builds packages in module-aware mode, ignoring the go.mod file in the current

View file

@ -568,6 +568,8 @@ Executables are installed in the directory named by the GOBIN environment
variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH
environment variable is not set. Executables in $GOROOT environment variable is not set. Executables in $GOROOT
are installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN. are installed in $GOROOT/bin or $GOTOOLDIR instead of $GOBIN.
Cross compiled binaries are installed in $GOOS_$GOARCH subdirectories
of the above.
If the arguments have version suffixes (like @latest or @v1.0.0), "go install" If the arguments have version suffixes (like @latest or @v1.0.0), "go install"
builds packages in module-aware mode, ignoring the go.mod file in the current builds packages in module-aware mode, ignoring the go.mod file in the current