From 119546ea4fdded79057913a943bd3b6a8dcf8d4a Mon Sep 17 00:00:00 2001 From: Sean Liao Date: Sun, 17 Aug 2025 12:46:13 +0100 Subject: [PATCH] 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 Reviewed-by: Carlos Amedee Reviewed-by: Michael Matloob --- src/cmd/go/alldocs.go | 2 ++ src/cmd/go/internal/work/build.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 5587e01d0a..69102231d2 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -758,6 +758,8 @@ // variable, which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH // environment variable is not set. Executables in $GOROOT // 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" // builds packages in module-aware mode, ignoring the go.mod file in the current diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index 4f81f1390c..53f5b04a77 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -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 environment variable is not set. Executables in $GOROOT 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" builds packages in module-aware mode, ignoring the go.mod file in the current -- 2.52.0