version

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package version exposes the build version shared by all tie binaries.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the build version. It is overridden at build time via

-ldflags "-X github.com/uidbz/tie/version.Version=v0.4.0"

(see the Makefile, which injects `git describe --tags --always --dirty`). When built without that flag the binary's embedded build info is used instead: the module version for a `go install pkg@version` build, else the VCS commit Go records for any build from a git checkout.

Functions

func String

func String() string

String returns the build version, preferring an ldflags-injected value, then the module version from build info, then the embedded VCS commit.

Types

type Info added in v0.5.3

type Info struct {
	// Version is the human-readable version: a tag (v0.5.2), a git description
	// (v0.5.2-3-g174d68f), a module pseudo-version, or a bare short commit —
	// suffixed "-dirty" when built from a modified tree without ldflags.
	Version string `json:"version"`
	// Commit is the full VCS revision when the build info carries one.
	Commit string `json:"commit,omitempty"`
	// Date is the commit timestamp (RFC 3339) when known.
	Date string `json:"date,omitempty"`
	// Dirty reports uncommitted changes in the tree the binary was built from.
	Dirty bool `json:"dirty,omitempty"`
	// GoVersion is the toolchain that built the binary.
	GoVersion string `json:"goVersion"`
}

Info describes the running build.

func Get added in v0.5.3

func Get() Info

Get returns the full build description. It never fails: fields that the build did not record are left empty and Version falls back to "dev".

Jump to

Keyboard shortcuts

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