debug.ReadBuildInfo is info.Main.Version always "(devel)"

1,048 views
Skip to first unread message

Amnon

unread,
Mar 16, 2022, 3:20:58 AM3/16/22
to golang-nuts
I was hoping to use debug.ReadBuildInfo to avoid using ugly --ldflags -X directives to insert the current git version into my runtime. This works as expected for dependencies. But the main module comes out as (devel). Is there a way to use ReadBuildInfo to get the actual tag and has of the main module?

Sean Liao

unread,
Mar 16, 2022, 5:38:04 PM3/16/22
to golang-nuts
Reply all
Reply to author
Forward
0 new messages