version

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version exposes the tai (core) binary's version string.

The value is set via -ldflags at build time; it defaults to "dev" for local builds so unbuilt-from-source binaries are recognisable.

go build -ldflags="-X github.com/dmastrorillo/tai/core/internal/version.String=v0.1.0"

String is a package-level variable (not a constant) because the Go linker can only inject values into vars. This is the project's sole documented exception to CLAUDE.md's "no package-level mutable state" rule. The init() block below writes to String exactly once at package-load time as a fallback for `go install github.com/dmastrorillo/tai/core/cmd/tai@vX.Y.Z` builds, which do NOT run goreleaser and therefore don't carry the -ldflags injection: it reads the module's tagged version via `runtime/debug.ReadBuildInfo()` and uses that. Linker injection still wins when present. After init no further mutation happens; tests MUST NOT mutate String.

Each binary in this module has its own version package so the linker can inject distinct values per binary in the same build matrix; the triage plugin's binary has an independent copy under plugins/triage/internal/version. First-party binaries (core + plugins in this repo) ship from this repo together, but the prefix-aware tag scheme owned by the `release-cycle` capability — bare `vX.Y.Z` for core, `plugins/<name>/vX.Y.Z` for plugins — lets each release on its own schedule when needed.

Index

Constants

This section is empty.

Variables

View Source
var String = "dev"

String is the version string surfaced by `tai --version`. Set EITHER via the linker (-ldflags -X — goreleaser path) OR via the init() block below (go install path). After init it is read-only.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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