]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.19: document cmd/go changes involving -trimpath
authorBryan C. Mills <bcmills@google.com>
Fri, 8 Apr 2022 20:02:59 +0000 (16:02 -0400)
committerBryan Mills <bcmills@google.com>
Tue, 12 Apr 2022 22:05:26 +0000 (22:05 +0000)
Updates #51461.

Change-Id: Ie878a9f630062d62027de895750a070b50428a9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/399214
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
doc/go1.19.html

index c1523c57ecb81abc5c364359f2f8c8881712e023..21781c3e3329ad1f202dbac4b7a80a17dab03566 100644 (file)
@@ -32,7 +32,27 @@ Do not send CLs removing the interior tags from such phrases.
 </p>
 <h3 id="go-command">Go command</h3>
 <p>
-  TODO: complete this section, or delete if not needed
+  TODO: complete this section.
+</p>
+
+<!-- https://go.dev/issue/51461 -->
+<p>
+  Passing the <code>-trimpath</code> flag to <code>go</code> commands now
+  causes <code>runtime.GOROOT()</code> in the resulting binary to return the
+  empty string instead of the string <code>"go"</code>.
+</p>
+<p>
+  The <code>-trimpath</code> flag, if set, is now included in the build settings
+  stamped into Go binaries by <code>go</code> <code>build</code>, and can be
+  examined using
+  <a href="https://pkg.go.dev/cmd/go#hdr-Print_Go_version"><code>go</code> <code>version</code> <code>-m</code></a>
+  or <a href="https://pkg.go.dev/runtime/debug#ReadBuildInfo"><code>debug.ReadBuildInfo</code></a>.
+</p>
+<p>
+  <code>go</code> <code>generate</code> now sets the <code>GOROOT</code>
+  environment variable explicitly in the generator's environment, so that
+  generators can locate the correct <code>GOROOT</code> even if built
+  with <code>-trimpath</code>.
 </p>
 
 <h4 id="go-unix">New <code>unix</code> build constraint</h4>