diff options
| author | Bryan C. Mills <bcmills@google.com> | 2022-03-15 16:37:50 -0400 |
|---|---|---|
| committer | Bryan Mills <bcmills@google.com> | 2022-03-18 21:55:03 +0000 |
| commit | 9ac75d39514402d9b314e758524dcc28612b8937 (patch) | |
| tree | bf2873b870c1263d294193dd1575cce056a9a2b5 /src/cmd/api | |
| parent | 9a932c5712bebb2620e0719a93773403f4fb563d (diff) | |
| download | go-9ac75d39514402d9b314e758524dcc28612b8937.tar.xz | |
cmd/link: avoid stamping runtime.defaultGOROOT when paths are being trimmed
Previously, runtime.GOROOT() would return the string "go" in a binary
build with -trimpath. This change stamps the empty string instead,
using a sentinel value passed from cmd/go that looks like the GOROOT
environment variable (either "$GOROOT" or "%GOROOT%", depending on the
platform).
Fixes #51461
Change-Id: I1f10ef2435016a7b6213bd8c547df911f7feeae7
Reviewed-on: https://go-review.googlesource.com/c/go/+/390024
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/api')
0 files changed, 0 insertions, 0 deletions
