Documentation
¶
Overview ¶
Package version reports the build version of pgoverlay's binaries (pgb, branchd, pgoverlay-github).
Release builds stamp the variables with the linker, for example:
go build -ldflags "-X github.com/abd-ulbasit/pgoverlay/internal/version.Version=v1.0.0 -X github.com/abd-ulbasit/pgoverlay/internal/version.Commit=1a2b3c4 -X github.com/abd-ulbasit/pgoverlay/internal/version.Date=2026-09-28T10:00:00Z"
`make build` fills them in from `git describe`. Unstamped builds fall back to the binary's embedded build info: `go install …/cmd/pgb@v1.0.0` reports v1.0.0, and a plain `go build` inside a checkout reports "dev" plus the VCS revision.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" Commit = "" Date = "" )
Set with -ldflags "-X …". Version stays "dev" for local builds.
Functions ¶
Types ¶
type Info ¶
type Info struct {
Version string // "v1.0.0", or "dev" for an unstamped local build
Commit string // VCS revision (at most 12 characters), "" when unknown
Date string // build or commit time (RFC 3339), "" when unknown
Modified bool // built from a checkout with uncommitted changes
GoVersion string // e.g. go1.26.5
Platform string // GOOS/GOARCH
}
Info is the resolved build identity: the ldflags values, completed from the embedded build info where they were left unset.
Click to show internal directories.
Click to hide internal directories.