version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package version holds build-time metadata injected by the release toolchain.

Variables are set via -ldflags at build time (see Makefile and .goreleaser.yaml). Local development builds fall back to "dev" / "unknown".

Example ldflags (from the Makefile):

-X github.com/uberware/sqi/internal/version.Version=v0.1.0
-X github.com/uberware/sqi/internal/version.Commit=abc1234
-X github.com/uberware/sqi/internal/version.BuildDate=2026-05-29T12:00:00Z
-X github.com/uberware/sqi/internal/version.GoVersion=go1.26.3

Index

Constants

This section is empty.

Variables

View Source
var BuildDate = "unknown"

BuildDate is the UTC timestamp of the build in RFC 3339 format.

View Source
var Commit = "unknown"

Commit is the short git commit hash of the build.

View Source
var GoVersion = "unknown"

GoVersion is the Go toolchain version used to build the binary.

View Source
var Version = "dev"

Version is the semantic version tag, e.g. "v0.1.0" or "dev".

Functions

This section is empty.

Types

type Info

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

Info is an immutable snapshot of the build metadata, suitable for injection into consumers (e.g. the API layer) that should not read the package variables directly so they can be tested deterministically.

func Get

func Get() Info

Get returns the current build metadata as an Info.

Jump to

Keyboard shortcuts

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