version: build-time version package + Makefile ldflags wiring

This commit is contained in:
2026-05-06 21:38:35 +01:00
parent a8256f5aff
commit 516c50fa16
2 changed files with 19 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
// Package version exposes build-time identifying constants. Both the
// server and agent link this package; their values are set via
// -ldflags during the build. An unset Version falls back to "dev"
// so source builds without ldflags still run.
package version
var (
// Version is the human-facing release string, e.g. "v1.2.3" or
// "v1.2.3-dirty". Compared byte-for-byte between agent and
// server to drive the "out of date" signal.
Version = "dev"
// Commit is the short git SHA. Informational only; surfaced via
// /api/version but not used for any comparison.
Commit = ""
)