Documentation
¶
Overview ¶
Package version exposes build identity for the binary.
The release workflow stamps Version via -ldflags:
go build -ldflags="-X github.com/mmedum/pipedrive-mcp/internal/version.Version=v1.2.3" ...
VCS metadata (commit SHA, build time, dirty flag) is read from runtime/debug.BuildInfo. Go's default -buildvcs=auto populates these for any module-rooted build, so they're free.
Note: we deliberately do NOT use BuildInfo.Main.Version for the tag — that field is "(devel)" for `go build` and only populates correctly under `go install module@version` (golang/go#29228). Tags must come from the linker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "dev"
Version is set at build time. Default "dev" for local builds.
Functions ¶
This section is empty.
Types ¶
type BuildInfo ¶
type BuildInfo struct {
Version string // tag (from -ldflags) or "dev"
Commit string // VCS revision; empty if unavailable
Time string // build time in RFC3339; empty if unavailable
Dirty bool // true if VCS reported uncommitted changes
GoVersion string
}
BuildInfo bundles the human-readable identity of the running binary.
Click to show internal directories.
Click to hide internal directories.