Documentation
¶
Overview ¶
Package project exposes the build identifiers populated by the architect-orb `go-build` job at link time (gitSHA, buildTimestamp). It has no dependencies so it can be safely imported by `main` and any CLI command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTimestamp ¶
func BuildTimestamp() string
BuildTimestamp returns the UTC build time in RFC 3339 format, or "unknown" when no ldflag was injected.
func GitSHA ¶
func GitSHA() string
GitSHA returns the commit SHA the binary was built from: the injected `gitSHA` ldflag, else the revision the Go toolchain stamped into the build info, else "dev".
func Version ¶
func Version() string
Version returns the best human-readable build identifier available, in order: the injected `version` ldflag, the release tag the Go toolchain stamped into the build info, the commit SHA, and finally the placeholder "dev".
The build info is only trusted when it names a tag. A build of an untagged commit gets a pseudo-version derived from the last tag before it, v5.23.3-0.<commit time>-<commit> (and while the module path had no /v5 suffix the toolchain only considered v0 and v1 tags, so even a release commit got v1.12.1-0.<commit time>-<commit>). Such a pseudo-version names no release and is ignored; releases carry their tag in the `version` ldflag, and since the module is github.com/giantswarm/muster/v5 a build of the tagged commit carries it in the build info as well.
Types ¶
This section is empty.