accessibility of module version information in executable

瀏覽次數:50 次
跳到第一則未讀訊息

Marvin Renich

未讀,
2020年6月26日 中午12:13:562020/6/26
收件者: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

未讀,
2020年6月26日 中午12:31:252020/6/26
收件者:golang-nuts
go version -m $binary

runtime/debug.BuildInfo

Marvin Renich

未讀,
2020年6月26日 中午12:53:572020/6/26
收件者: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

回覆所有人
回覆作者
轉寄
0 則新訊息