diff --git a/doc/go1.11.html b/doc/go1.11.html index afe1939766..16b4c904cb 100644 --- a/doc/go1.11.html +++ b/doc/go1.11.html @@ -348,6 +348,20 @@ updating. See the Go 1.10 release notes for details.

+

Go command

+ +

+ The environment variable GOFLAGS may now be used + to set default flags for the go command. + This is useful in certain situations. + Linking can be noticeably slower on underpowered systems due to DWARF, + and users may want to set -ldflags=-w by default. + For modules, some users and CI systems will want vendoring always, + so they should set -mod=vendor by default. + For more information, see the go + command documentation. +

+

Godoc

diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 35cabcac14..969d51f5ab 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1449,6 +1449,12 @@ // The directory where the go command will write // temporary source files, packages, and binaries. // +// Each entry in the GOFLAGS list must be a standalone flag. +// Because the entries are space-separated, flag values must +// not contain spaces. In some cases, you can provide multiple flag +// values instead: for example, to set '-ldflags=-s -w' +// you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. +// // Environment variables for use with cgo: // // CC diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index aff4ce12f6..e2c4e61615 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -507,6 +507,12 @@ General-purpose environment variables: The directory where the go command will write temporary source files, packages, and binaries. +Each entry in the GOFLAGS list must be a standalone flag. +Because the entries are space-separated, flag values must +not contain spaces. In some cases, you can provide multiple flag +values instead: for example, to set '-ldflags=-s -w' +you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. + Environment variables for use with cgo: CC