Help us shape the future of Go! Take the 2026 Go Developer Survey

buildinfo

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

Read is debug.ReadBuildInfo. It is a variable only so tests can stub it.

Functions

func Describe

func Describe(commit string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL