]> Cypherpunks repositories - gostls13.git/commit
cmd/go: move module build info formatting into runtime/debug
authorJay Conrod <jayconrod@google.com>
Thu, 30 Sep 2021 21:37:30 +0000 (14:37 -0700)
committerJay Conrod <jayconrod@google.com>
Thu, 14 Oct 2021 18:43:59 +0000 (18:43 +0000)
commit765c9116be44641854f580c19e3589d7b86a3d28
treea7966442083ff5e4681a0470cc9bd38cc62fdcd5
parent011fd002457da0823da5f06b099fcf6e21444b00
cmd/go: move module build info formatting into runtime/debug

Previously, modload.PackageBuildInfo returned a string containing
information about modules used to build an executable. This string is
embedded in the binary and can be read with debug.ReadBuildInfo or
'go version -m'.

With this change, debug.BuildInfo now has a MarshalText method that
returns a string in the same format as modload.PackageBuildInfo.

Package.load now calls Package.setBuildInfo, which constructs a
debug.BuildInfo, formats it with MarshalText, then sets
Package.Internal.BuildInfo. This is equivalent to what
modload.PackageBuildInfo did.

modload.PackageBuildInfo is deleted, since it's no longer used.

For #37475

Change-Id: I5875a98cb64737637fec2a450ab2ffa7f1805707
Reviewed-on: https://go-review.googlesource.com/c/go/+/353886
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
api/next.txt
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modload/build.go
src/runtime/debug/mod.go