GitPedia

Versioninfo

Importable package that parses version info from debug.ReadBuildInfo().

From earthboundkid·Updated May 29, 2026·View on GitHub·

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 GoDoc Go Report Card

Importable package that parses debug.ReadBuildInfo() for inclusion in your Go application. Requires Go 1.18+.

Examples

go
package 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():

go
package main import ( "fmt" "github.com/earthboundkid/versioninfo/v2" ) func main() { fmt.Println("ShortInfo:", versioninfo.Short()) }

Add the -v and -version flags:

go
package 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.

View all contributors on GitHub →

This article is auto-generated from earthboundkid/versioninfo via the GitHub API.Last fetched: 6/26/2026