aboutsummaryrefslogtreecommitdiff
path: root/src/make.rc
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2018-07-29 01:10:02 -0400
committerRuss Cox <rsc@golang.org>2018-08-01 00:35:21 +0000
commitc1a4fc3b36ccfe0022392224c2630f7971c156fe (patch)
tree12f32ebe5c1816053bd59726ff851e9733cd69bc /src/make.rc
parent53859e575ba0f0b84914e7dc5c2a09b6b0c5d96f (diff)
downloadgo-c1a4fc3b36ccfe0022392224c2630f7971c156fe.tar.gz
go-c1a4fc3b36ccfe0022392224c2630f7971c156fe.zip
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.rc')
-rwxr-xr-xsrc/make.rc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/make.rc b/src/make.rc
index 7ae6221b38..a97dfc8a01 100755
--- a/src/make.rc
+++ b/src/make.rc
@@ -47,7 +47,7 @@ if(~ $1 -v) {
shift
}
-
+GOFLAGS=()
GOROOT = `{cd .. && pwd}
if(! ~ $#GOROOT_BOOTSTRAP 1)
GOROOT_BOOTSTRAP = $home/go1.4