version

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package version exposes build metadata injected at link time via `go build -ldflags "-X ...Version=..." -ldflags "-X ...Commit=..." -ldflags "-X ...BuildTime=..."`. Default values keep development builds informative without requiring an LDFLAGS dance.

Index

Constants

This section is empty.

Variables

View Source
var BuildTime = ""

BuildTime is the ISO-8601 UTC timestamp at which the binary was built. Set at link time via -ldflags. Empty for non-LDFLAGS builds.

View Source
var Commit = ""

Commit is the short git SHA the binary was built from. Set at link time via -ldflags. Empty for non-LDFLAGS builds.

View Source
var Version = "dev"

Version is the human-readable build version. Set at link time by the Makefile + release workflow to the git tag (e.g. "v1.0.0") or `git describe` output for in-development builds. Defaults to "dev" for `go run` / `go test` invocations.

Functions

func String

func String() string

String returns a single-line summary suitable for logging or for the `gophertrunk version` subcommand: "vX.Y.Z (sha=ABC1234, built=2026-05-13T19:00:00Z)". Empty Commit / BuildTime are omitted so dev builds stay compact.

Types

This section is empty.

Jump to

Keyboard shortcuts

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