Documentation
¶
Overview ¶
Package version describes the build. algodtop has no release numbers: every commit on main is a release, and Go names it with a pseudo-version that holds the commit's UTC time, such as v0.0.0-20261104123549-37f0e9db466c. A build can still set a version at link time with -ldflags "-X algod.top/internal/version.Version=...".
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the release version set at link time, or "dev".
Functions ¶
Types ¶
type Build ¶
type Build struct {
Version string // such as v0.0.0-20261104123549-37f0e9db466c, or "dev"
Revision string // the commit hash, when known
Time time.Time // the commit time in UTC, when known
Modified bool // built from a tree with uncommitted changes
}
Build is what the binary knows about the commit it came from.
func Info ¶
func Info() Build
Info reads the build. A local build in a git checkout knows its commit from the VCS stamp. A build by go install knows it from the pseudo-version.
func Parse ¶
Parse reads a version string into a Build, with the commit time and hash when it is a pseudo-version.
func (Build) Describe ¶
Describe names the build by its commit's time and age, such as "2026-11-04 12:35 UTC (37f0e9db), 3 days old". A version set at link time comes first. A build with no commit time, such as one from a source archive, gets String.