Skip to content

Commit d85694a

Browse files
author
Bryan C. Mills
committed
doc/go1.19: document cmd/go changes involving -trimpath
Updates #51461. Change-Id: Ie878a9f630062d62027de895750a070b50428a9f Reviewed-on: https://go-review.googlesource.com/c/go/+/399214 Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f66925e commit d85694a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

doc/go1.19.html

+21-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,27 @@ <h2 id="tools">Tools</h2>
3232
</p>
3333
<h3 id="go-command">Go command</h3>
3434
<p>
35-
TODO: complete this section, or delete if not needed
35+
TODO: complete this section.
36+
</p>
37+
38+
<!-- https://go.dev/issue/51461 -->
39+
<p>
40+
Passing the <code>-trimpath</code> flag to <code>go</code> commands now
41+
causes <code>runtime.GOROOT()</code> in the resulting binary to return the
42+
empty string instead of the string <code>"go"</code>.
43+
</p>
44+
<p>
45+
The <code>-trimpath</code> flag, if set, is now included in the build settings
46+
stamped into Go binaries by <code>go</code> <code>build</code>, and can be
47+
examined using
48+
<a href="https://pkg.go.dev/cmd/go#hdr-Print_Go_version"><code>go</code> <code>version</code> <code>-m</code></a>
49+
or <a href="https://pkg.go.dev/runtime/debug#ReadBuildInfo"><code>debug.ReadBuildInfo</code></a>.
50+
</p>
51+
<p>
52+
<code>go</code> <code>generate</code> now sets the <code>GOROOT</code>
53+
environment variable explicitly in the generator's environment, so that
54+
generators can locate the correct <code>GOROOT</code> even if built
55+
with <code>-trimpath</code>.
3656
</p>
3757

3858
<h4 id="go-unix">New <code>unix</code> build constraint</h4>

0 commit comments

Comments
 (0)