{"modulePath":"github.com/DomBlack/git-stack","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package version\n\nPackage version works out which git-stack this binary is.\n\nThree sources are tried in order: the value goreleaser stamps in with ldflags at release time, the module version recorded by \\`go install github.com/DomBlack/git-stack@vX.Y.Z\\`, and finally the VCS details that \\`go build\\` records for a checkout, so a dev build still says which commit it came from.\n\n## Functions\n\n```go\nfunc Compare(a, b string) int\n```\nCompare orders two versions: negative when a is older than b, zero when equal, positive when newer. Anything that is not vX.Y.Z (a dev build, a pseudo version) sorts before every real release.\n\n```go\nfunc IsRelease(v string) bool\n```\nIsRelease reports whether v is a release version (vX.Y.Z), not a dev build or pseudo version.\n\n## Types\n\n```go\ntype Info struct {\n\t// Version is \"vX.Y.Z\" for a release, a pseudo version for `go install\n\t// @main`, or \"dev\" for a local build.\n\tVersion string `json:\"version\"`\n\t// Release is true when Version names a published release that\n\t// `git stack update` can compare against.\n\tRelease bool `json:\"release\"`\n\t// Commit is the short VCS revision when known.\n\tCommit string `json:\"commit,omitempty\"`\n\t// Date is the commit date (YYYY-MM-DD) when known.\n\tDate string `json:\"date,omitempty\"`\n\t// Dirty is true when the checkout had uncommitted changes.\n\tDirty bool `json:\"dirty,omitempty\"`\n\n\tGoVersion string `json:\"go\"`\n\tOS        string `json:\"os\"`\n\tArch      string `json:\"arch\"`\n}\n```\nInfo describes the running binary.\n\n```go\nfunc Current() Info\n```\nCurrent resolves the running binary's version.\n\n```go\nfunc Resolve(ldflags string, bi *debug.BuildInfo) Info\n```\nResolve builds an Info from the linker value and the build info. It is split out from Current so tests can feed in fixed inputs.\n\n```go\nfunc (i Info) String() string\n```\nString is the human form: \"v1.2.3\", or \"dev (3a9f2c1, 2026-09-30, dirty)\".\n\n","path":"github.com/DomBlack/git-stack/pkg/version","name":"version","synopsis":"Package version works out which git-stack this binary is.","isRedistributable":true}
