Documentation
¶
Overview ¶
Package buildinfo reads the Go build information stamped into the AgentGuard binaries. Builds that skip the Makefile's -ldflags — `go install …@vX.Y.Z`, a plain `go build`, a Docker build without a COMMIT build arg — keep the "dev" commit placeholder; this package lets them still report a meaningful identifier, and lets the update check tell a tagged release from a development build.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Read = debug.ReadBuildInfo
Read is debug.ReadBuildInfo. It is a variable only so tests can stub it.
Functions ¶
func Describe ¶
Describe returns the identifier printed next to the version for a binary whose -ldflags-injected commit is commit. For the "dev" placeholder it falls back to build info: the short VCS revision of a source build (with "-dirty" when the tree was modified), else the module version of a `go install` build ("module v1.1.1"), else "dev".
func ReleaseVersion ¶
func ReleaseVersion() string
ReleaseVersion returns the main module's version when it is a tagged release such as "v1.1.1": what `go install <module>/cmd/…@v1.1.1` (or `@latest`) records, and what `go build` records on a clean checkout of a release tag (Go 1.24+). It returns "" for everything else — "(devel)", pseudo-versions of untagged commits, pre-releases and "+dirty" builds.
Types ¶
This section is empty.