Documentation
¶
Overview ¶
Package version identifies the running build.
A daemon installed by `outpost install` can run unattended for months. When it misbehaves the first question is which binary is actually running, and answering it should not require guessing from file timestamps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version string Commit string Date string )
Set at link time by the release build:
go build -ldflags "-X github.com/sroberts/outpost/internal/version.Version=v1.2.3"
Left empty by a plain `go build`, which falls back to the VCS stamp the Go toolchain embeds on its own — so even an unreleased local build identifies itself rather than claiming to be nothing in particular.
Functions ¶
Types ¶
type Info ¶
type Info struct {
Version string
Commit string
Date string
// Dirty reports that the working tree had uncommitted changes at build
// time, which makes Commit an approximation rather than an identity.
Dirty bool
// DateIsCommit distinguishes the two things Date can be. With no link-time
// stamp the only timestamp available is the commit's, and calling that a
// build date would mislead whoever is reading it during an incident.
DateIsCommit bool
Go string
OS string
Arch string
}
Info is what the binary knows about itself.
func Get ¶
func Get() Info
Get reads the build stamp, preferring link-time values and falling back to what the toolchain recorded.