]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.16: document BuildID in 'go list -export'
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 22 Oct 2020 15:30:26 +0000 (16:30 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 27 Oct 2020 20:22:56 +0000 (20:22 +0000)
This corresponds to the feature in https://golang.org/cl/263542, since
this can be a noteworthy change to people writing tools to inspect Go
builds.

Also amend the wording to clarify that build IDs are for an entire
compiled package, not just their export data or object file.

Change-Id: I2eb295492807d5d2997a35e5e2371914cb3ad3a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/264158
Trust: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
doc/go1.16.html
src/cmd/go/alldocs.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/load/pkg.go

index 9e7ae1da272f629eae9d5f5a7d26e64a22e15768..ba2f80f95ec26cbf4ae03e97fdc5681ef6867db8 100644 (file)
@@ -131,6 +131,16 @@ Do not send CLs removing the interior tags from such phrases.
   being built.
 </p>
 
+<h4 id="list-buildid">The <code>list</code> command</h4>
+
+<p><!-- golang.org/cl/263542 -->
+  When the <code>-export</code> flag is specified, the <code>BuildID</code>
+  field is now set to the build ID of the compiled package. This is equivalent
+  to running <code>go</code> <code>tool</code> <code>buildid</code> on
+  <code>go</code> <code>list</code> <code>-exported</code> <code>-f</code> <code>{{.Export}</code>,
+  but without the extra step.
+</p>
+
 <h3 id="cgo">Cgo</h3>
 
 <p> <!-- CL 252378 -->
index 0827f0c609b798285af3f57a23d0a817efd4098f..23d44ddc708399ebbfb3b8f4b17927d3a1423446 100644 (file)
 //         BinaryOnly    bool     // binary-only package (no longer supported)
 //         ForTest       string   // package is only for use in named test
 //         Export        string   // file containing export data (when using -export)
-//         BuildID       string   // build ID of the export data (when using -export)
+//         BuildID       string   // build ID of the compiled package (when using -export)
 //         Module        *Module  // info about package's containing module, if any (can be nil)
 //         Match         []string // command-line patterns matching this package
 //         DepOnly       bool     // package is only a dependency, not explicitly listed
index 1c77e4d4782abaf2b355679da5fa20622141702e..89088f5defb012e10c2cde77cd3b293bb5842490 100644 (file)
@@ -66,7 +66,7 @@ to -f '{{.ImportPath}}'. The struct being passed to the template is:
         BinaryOnly    bool     // binary-only package (no longer supported)
         ForTest       string   // package is only for use in named test
         Export        string   // file containing export data (when using -export)
-        BuildID       string   // build ID of the export data (when using -export)
+        BuildID       string   // build ID of the compiled package (when using -export)
         Module        *Module  // info about package's containing module, if any (can be nil)
         Match         []string // command-line patterns matching this package
         DepOnly       bool     // package is only a dependency, not explicitly listed
index 615b5ef769bb60f3447cb7b681763842ff0bb865..4c541b9017725c43a79943d502ca36f0d54ccf88 100644 (file)
@@ -61,7 +61,7 @@ type PackagePublic struct {
        ConflictDir   string                `json:",omitempty"` // Dir is hidden by this other directory
        ForTest       string                `json:",omitempty"` // package is only for use in named test
        Export        string                `json:",omitempty"` // file containing export data (set by go list -export)
-       BuildID       string                `json:",omitempty"` // build ID of the export data (set by go list -export)
+       BuildID       string                `json:",omitempty"` // build ID of the compiled package (set by go list -export)
        Module        *modinfo.ModulePublic `json:",omitempty"` // info about package's module, if any
        Match         []string              `json:",omitempty"` // command-line patterns matching this package
        Goroot        bool                  `json:",omitempty"` // is this package found in the Go root?