ubgo is in early alpha: libraries and APIs may still change.

Skip to content
ubgo Alpha

buildinfo

Version, commit, build time and module info for Go binaries, from runtime/debug with -ldflags overrides.

go get github.com/ubgo/buildinfo
Language
Go
Go version
1.24
Core deps
0 direct
Latest tag
v0.1.2
License
Apache-2.0
Go modules
9

How it fits together

Code from the README

package main

import (
    "log"

    "github.com/ubgo/buildinfo"
)

func main() {
    info := buildinfo.Get()
    log.Printf("starting %s commit=%s go=%s",
        info.Version, info.Commit, info.GoVersion)
}

From the buildinfo README.

At a glance (from the README)

SourceMeaning
SourceLdflagsstamped at build time by the release pipeline
SourceModuleresolved by go install <pkg>@<version>
SourceUnknownplain go build / go run / go test — Version is the DevVersion placeholder