Documentation
¶
Overview ¶
Package version exposes build metadata (git commit, build time, version). The values are injected at build time via -ldflags "-X ...":
go build -ldflags "\ -X github.com/lgldsilva/jackui/internal/version.Commit=$(git rev-parse HEAD) \ -X github.com/lgldsilva/jackui/internal/version.BuildTime=$(date +%s) \ -X github.com/lgldsilva/jackui/internal/version.Version=$(git describe --tags --always)"
Without ldflags (e.g. `go run` in dev) they keep the defaults below, so the /status endpoint still answers — it just reports "dev"/"unknown".
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Commit is the full git SHA the binary was built from. Commit = "unknown" // BuildTime is the build instant. Accepts a unix epoch (what the Docker // BUILD_TIMESTAMP arg carries) or an RFC3339 string; Info() normalises it. BuildTime = "unknown" // Version is a human tag (e.g. `git describe --tags --always`). Version = "dev" )
Injected via -ldflags. Defaults cover local `go run`/`go test` (no ldflags).
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.