version

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package version provides the canonical version string for yaad.

Single source of truth: the VERSION file at the repo root, which is kept in sync with the co-located internal/version/VERSION via the `make tidy` target (or `release-please`, which bumps both atomically).

The co-located VERSION file is embedded at compile time via `go:embed`, so `go build`, `go install`, and `go get` all see the correct version with zero ldflags wiring required. Release builds (goreleaser, or `make build` if a binary is ever added) may additionally inject a short commit + build date through ldflags:

go build -ldflags " \
  -X github.com/GrayCodeAI/yaad/internal/version.Commit=$(git rev-parse --short HEAD) \
  -X github.com/GrayCodeAI/yaad/internal/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)"

Do NOT edit Version directly — bump the root VERSION file and resync the co-located one (or let release-please/goreleaser do it).

Index

Constants

This section is empty.

Variables

View Source
var Commit = "none"

Commit is the git commit short SHA. Set via ldflags at release time; defaults to "none" for plain `go build`.

View Source
var Date = "unknown"

Date is the build date in RFC3339. Set via ldflags at release time; defaults to "unknown" for plain `go build`.

View Source
var Version = strings.TrimSpace(versionFile)

Version is the current version of yaad, embedded from the VERSION file at compile time.

Functions

func Full

func Full() string

Full returns a verbose, human-readable version string suitable for `yaad --version` output.

func String

func String() string

String returns just the version string (kept for backwards compatibility with existing call sites that do `fmt.Printf("yaad v%s", version.String())`).

Types

This section is empty.

Jump to

Keyboard shortcuts

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