Documentation
¶
Overview ¶
Package buildinfo exposes metadata embedded by the Go linker at build time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Overridden via -ldflags -X at release build time. Version = "dev" Commit = "unknown" BuildDate = "unknown" )
Functions ¶
func NormalizeVersion ¶
NormalizeVersion ensures release versions are "vX.Y.Z". Leaves "dev" and already-prefixed values unchanged.
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
}
Info is safe-to-print build metadata.
func Current ¶
func Current() Info
Current returns embedded build metadata. Version is normalized to include a leading "v" when it looks like a SemVer without one, so brew tests can assert `version_info["version"] == "v#{version}"`.
func (Info) IsDevelopment ¶
IsDevelopment reports whether this is a local/dev build.
Click to show internal directories.
Click to hide internal directories.