Get ldflags from binary file

Hello

I have a HelloWorld program. I make this command to build

go build -ldflags “-X main.Version=v1.1” main.go

Its possible create a application in go, that read the binary and get
get the value of variable Version (on this example was “v.1.1”).

Thanks

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.