aboutsummaryrefslogtreecommitdiff
path: root/src/run.bat
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/run.bat
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/run.bat')
-rw-r--r--src/run.bat1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/run.bat b/src/run.bat
index 6e42922a86..0e0c413617 100644
--- a/src/run.bat
+++ b/src/run.bat
@@ -17,6 +17,7 @@ set GOBUILDFAIL=0
set GOPATH=
:: Issue 14340: ignore GOBIN during all.bat.
set GOBIN=
+set GOFLAGS=
rem TODO avoid rebuild if possible