version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package version exposes build-time metadata injected via -ldflags.

The variables Version, Commit, and BuiltAt are normally set by the Makefile (or CI) using linker flags; their zero values are appropriate for `go run` and `go test` only. GSEER never claims a version it cannot substantiate (SPEC-03 §4: checksums, not signatures, in v0.0.1; `gseer doctor` prints the running binary's SHA-256).

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version string, e.g. "v0.0.1".  When built
	// without ldflags it is "dev" — `gseer doctor` reports this honestly.
	Version = "dev"
	// Commit is the VCS commit hash the binary was built from.  Empty
	// when built without ldflags (e.g. `go run`); reported as "unknown".
	Commit = ""
	// BuiltAt is the build timestamp in RFC3339 form.  Empty when built
	// without ldflags; reported as "unknown".
	BuiltAt = ""
)

Variables injected via -ldflags "-X ...". Defaults are intentionally honest: when not injected, we say so plainly rather than fabricating a version (AC-8.x documentation honesty; the honesty floor).

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuiltAt   string `json:"built_at"`
	GoVersion string `json:"go_version"`
}

Info is the structured form of the build metadata. The CLI's `version` command renders this; future surfaces (doctor, /api/v1/version) reuse it.

func Current

func Current() Info

Current returns the build metadata for the running binary. Go runtime version is always available; the other fields reflect ldflags injection.

func (Info) String

func (i Info) String() string

String renders the version block as a human-readable multi-line string. Format is stable so that tests and the QUICKSTART can pin it.

Jump to

Keyboard shortcuts

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