diff options
author | Russ Cox <rsc@golang.org> | 2018-07-29 01:10:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2018-08-01 00:35:21 +0000 |
commit | c1a4fc3b36ccfe0022392224c2630f7971c156fe (patch) | |
tree | 12f32ebe5c1816053bd59726ff851e9733cd69bc /src/make.bash | |
parent | 53859e575ba0f0b84914e7dc5c2a09b6b0c5d96f (diff) | |
download | go-git-c1a4fc3b36ccfe0022392224c2630f7971c156fe.tar.gz |
cmd/go: add $GOFLAGS environment variable
People sometimes want to turn on a particular go command flag by default.
In Go 1.11 we have at least two different cases where users may need this.
1. Linking can be noticeably slower on underpowered systems
due to DWARF, and users may want to set -ldflags=-w by default.
2. For modules, some users or CI systems will want vendoring always,
so they want -getmode=vendor (soon to be -mod=vendor) by default.
This CL generalizes the problem to “set default flags for the go command.”
$GOFLAGS can be a space-separated list of flag settings, but each
space-separated entry in the list must be a standalone flag.
That is, you must do 'GOFLAGS=-ldflags=-w' not 'GOFLAGS=-ldflags -w'.
The latter would mean to pass -w to go commands that understand it
(if any do; if not, it's an error to mention it).
For #26074.
For #26318.
Fixes #26585.
Change-Id: I428f79c1fbfb9e41e54d199c68746405aed2319c
Reviewed-on: https://go-review.googlesource.com/126656
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-x | src/make.bash | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash index a28b82a058..78882d9834 100755 --- a/src/make.bash +++ b/src/make.bash @@ -63,6 +63,7 @@ set -e unset GOBIN # Issue 14340 +unset GOFLAGS if [ ! -f run.bash ]; then echo 'make.bash must be run from $GOROOT/src' 1>&2 |