Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage debug.BuildInfo from go 1.18 #25

Open
endorama opened this issue Mar 30, 2022 · 0 comments
Open

Leverage debug.BuildInfo from go 1.18 #25

endorama opened this issue Mar 30, 2022 · 0 comments

Comments

@endorama
Copy link
Member

Go 1.18 provides some built in information to retrieve VCS status from the binary via debug.BuildInfo

Quoting:

The runtime/debug.BuildInfo returned by runtime/debug.ReadBuildInfo() has been updated to include a new field Settings []debug.BuildSetting. Settings in turn are key-value pairs describing a binary. The commit hash is the value for the key vcs.revision, and vcs.time does what you would expect. There’s even vcs.modified to tell you if the build was “dirty” or “clean”.

An example implementation https://github.com/carlmjohnson/versioninfo

We should replace current implementation in version with debug.BuildSetting values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant