accessibility of module version information in executable

50 views
Skip to first unread message

Marvin Renich

unread,
Jun 26, 2020, 12:13:56 PM6/26/20
to golan...@googlegroups.com
When building a command with go build that imports modules, does the
resulting executable contain information about which modules are
included as well as their versions?

If so, is there a tool available to extract that information from the
executable? Can the information be retrieved from within the program
(e.g. through the runtime package)?

If not, would a request for this be received favorably?

...Marvin

seank...@gmail.com

unread,
Jun 26, 2020, 12:31:25 PM6/26/20
to golang-nuts
go version -m $binary

runtime/debug.BuildInfo

Marvin Renich

unread,
Jun 26, 2020, 12:53:57 PM6/26/20
to golang-nuts
* seank...@gmail.com <seank...@gmail.com> [200626 12:31]:
> go version -m $binary
>
> runtime/debug.BuildInfo

Thanks much! I looked through runtime, but did not think to look at
runtime/debug. I was completely unaware of the -m option to go version.

...Marvin

Reply all
Reply to author
Forward
0 new messages