Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package version exposes funcd's build identity. Version/Commit/Date are written at link time via -ldflags "-X …version.Version=…" (the one sanctioned mutable-globals seam — ADR-0002 §5 / ADR-0026); GoVersion + Platform come from the runtime. An un-stamped build returns the honest "dev"/"none"/"unknown" defaults so it's obvious.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

The ldflags-stamp seam. //nolint is required — gochecknoglobals fires on these names (same inline form as the lookup-table globals in api/fault/problem.go, pkg/sdk/kinds.go).

Functions

func Compare added in v0.10.0

func Compare(a, b string) (c int, ok bool)

Compare orders two scripts/build.sh stamps (ADR-0207): a trailing -dirty and -<n>-g<hash> are cut, the tags compare by semver, equal tags by n (none: 0). ok is false when either is "dev" or no semver tag is left (a bare hash: a clone without tags).

Types

type Info

type Info struct {
	Version   string
	Commit    string
	Date      string
	GoVersion string
	Platform  string
}

Info is the assembled build identity.

func Get

func Get() Info

Get returns this build's Info: the stamp vars plus the runtime-derived Go version and OS/arch (always filled, even on an un-stamped build).

func (Info) String

func (i Info) String() string

String renders the build identity as one human line.

Jump to

Keyboard shortcuts

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