aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/cfg/cfg.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-04-22 23:55:27 -0400
committerRuss Cox <rsc@golang.org>2019-04-24 14:25:09 +0000
commit74695644e0c38586a85b9b483830c546efbb6642 (patch)
tree1798977e86114cda7a1fb50cdf85885f9ad686ce /src/cmd/go/internal/cfg/cfg.go
parent8a20fde697c973962d978c1284fddf81a694141a (diff)
downloadgo-74695644e0c38586a85b9b483830c546efbb6642.tar.gz
go-74695644e0c38586a85b9b483830c546efbb6642.zip
cmd/go: add -trimpath build flag
"go build -trimpath" trims the recorded file paths in the resulting packages and executables to avoid recording the names of any local directories. Instead, the files appear to be stored in directories named either "go/src/..." (for the standard library) or named after the module or package in which the files appear. Fixes #16860. Change-Id: I433afeeb1fdeea641286b21693fee5e0a66d607e Reviewed-on: https://go-review.googlesource.com/c/go/+/173345 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/cfg/cfg.go')
-rw-r--r--src/cmd/go/internal/cfg/cfg.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 1060c8f6df..38cdf639e2 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -38,6 +38,7 @@ var (
BuildToolchainName string
BuildToolchainCompiler func() string
BuildToolchainLinker func() string
+ BuildTrimpath bool // -trimpath flag
BuildV bool // -v flag
BuildWork bool // -work flag
BuildX bool // -x flag