commit | 434cdd0337b9e6c7e0c369c9293cc14fd38dc80d | [log] [tgz] |
---|---|---|
author | Jay Conrod <jayconrod@google.com> | Thu Sep 30 10:25:49 2021 -0700 |
committer | Jay Conrod <jayconrod@google.com> | Thu Oct 14 18:44:08 2021 +0000 |
tree | c3bed1de3166cdfbd3cbb7ea86858c62a5a8945d | |
parent | 765c9116be44641854f580c19e3589d7b86a3d28 [diff] |
debug/buildinfo: new package with Read and ReadFile These functions provide access to module information stamped into Go binaries. In the future, they'll provide access to other information (like VCS info). These functions are added in a new package instead of runtime/debug since they use binary parsing packages like debug/elf, which would make runtime/debug an unacceptably heavy dependency. The types in runtime/debug are still used; debug/buildinfo uses them via type aliases. This information is already available for the running binary through debug.ReadBuildInfo and for other binaries with 'go version -m', but until now, there hasn't been a way to get it for other binaries without installing cmd/go. This change copies most of the code in cmd/go/internal/version. A later CL will migrate 'go version -m' to use this package. For #37475 Fixes #39301 Change-Id: I0fbe0896e04f12ef81c6d79fb61b20daede86159 Reviewed-on: https://go-review.googlesource.com/c/go/+/353887 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.