From 85cbdda5a6d8525973580776c835e725452db898 Mon Sep 17 00:00:00 2001
From: Jay Conrod
+ The go
command now embeds version control information in
+ binaries including the currently checked-out revision and a flag indicating
+ whether edited or untracked files are present. Version control information
+ is embedded if the go
command is invoked in a directory within a
+ Git or Mercurial repository, and the main
package and its
+ containing main module are in the same repository. This information may be
+ omitted using the flag -buildvcs=false
.
+
+ Additionally, the go
command embeds information about the build
+ including build and tool tags (set with -tags
), compiler,
+ assembler, and linker flags (like -gcflags
), whether cgo was
+ enabled, and if it was, the values of the cgo environment variables
+ (like CGO_CFLAGS
). This information may be omitted using the
+ flag -buildinfo=false
. Both VCS and build information may be
+ read together with module information using go
+ version
-m
file
or
+ runtime/debug.ReadBuildInfo
(for the currently running binary)
+ or the new debug/buildinfo
+ package.
+
TODO: complete this section, or delete if not needed
@@ -114,6 +138,19 @@ Do not send CLs removing the interior tags from such phrases. TODO: complete this section +
+ This new package provides access to module versions, version control
+ information, and build flags embedded in executable files built by
+ the go
command. The same information is also available via
+ runtime/debug.ReadBuildInfo
+ for the currently running binary and via go
+ version
-m
on the command line.
+