Versioninfo
Importable package that parses version info from debug.ReadBuildInfo().
Importable package that parses `debug.ReadBuildInfo()` for inclusion in your Go application. Requires Go 1.18+. The project is written primarily in Go, distributed under the MIT License license, first published in 2021. Key topics include: git, go, golang, version-control-system, versioning.
Latest release: v2.24.1
November 11, 2024View Changelog →
versioninfo

Importable package that parses debug.ReadBuildInfo() for inclusion in your Go application. Requires Go 1.18+.
Examples
gopackage main import ( "fmt" "github.com/earthboundkid/versioninfo/v2" ) func main() { fmt.Println("Version:", versioninfo.Version) fmt.Println("Revision:", versioninfo.Revision) fmt.Println("DirtyBuild:", versioninfo.DirtyBuild) fmt.Println("LastCommit:", versioninfo.LastCommit) }
You may use the concatenated information provided by versioninfo.Short():
gopackage main import ( "fmt" "github.com/earthboundkid/versioninfo/v2" ) func main() { fmt.Println("ShortInfo:", versioninfo.Short()) }
Add the -v and -version flags:
gopackage main import ( "flag" "fmt" "github.com/earthboundkid/versioninfo/v2" ) func main() { versioninfo.AddFlag(nil) flag.Parse() fmt.Println("done") }
Contributors
Showing top 3 contributors by commit count.
This article is auto-generated from earthboundkid/versioninfo via the GitHub API.Last fetched: 6/26/2026
