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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message