]> Cypherpunks repositories - gostls13.git/commit
runtime/debug: add API to read module info in binary
authorHana Kim <hyangah@gmail.com>
Tue, 23 Oct 2018 21:00:29 +0000 (17:00 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Tue, 13 Nov 2018 17:16:48 +0000 (17:16 +0000)
commit45e9c5538b3956d98ef0337fc19ed8d45eb17090
tree6adcb1d65d5188d58e03fa7271093fbaa66523b7
parent978cfa8e46d71992395d67382e96036596520cb6
runtime/debug: add API to read module info in binary

When module is enabled, the go tool embeds build information
related to the module in the binary including the dependencies
and the replace information (See
src/cmd/go/internal/modload.PackageBuildInfo).

The newly introduced ReadBuildInfo reads the information and
makes it accessible programmatically.

Update #26404

Change-Id: Ide37022d609b4a8fb6b5ce02afabb73f04fbb532
Reviewed-on: https://go-review.googlesource.com/c/144220
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/testdata/script/mod_modinfo.txt [new file with mode: 0644]
src/runtime/debug/mod.go [new file with mode: 0644]