Skip to content

Leverage debug.BuildInfo from go 1.18  #25

@endorama

Description

@endorama

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions