buildinfo

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Set by GoReleaser (and the Makefile) via -ldflags. Unstamped builds (`go run`, `go test`) keep these defaults; no VCS probing at runtime.

Functions

func CanonicalVersion added in v1.0.7

func CanonicalVersion(v string) string

CanonicalVersion strips a leading v/V so git-describe stamps ("v1.0.6") match GoReleaser {{.Version}} ("1.0.6"). Other characters are kept.

func IsDev added in v1.0.6

func IsDev(version, commit string) bool

IsDev reports an unstamped identity: Version/Commit left at the `go run` / `go test` defaults. Makefile and GoReleaser always override both. Empty strings are not IsDev — a peer that omitted handshake headers is a missing identity, not a dev process.

Types

type Info added in v1.0.2

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"go_version"`
	Dirty     bool   `json:"dirty,omitempty"`
}

Info is the JSON shape of GET /api/version.

func Snapshot added in v1.0.2

func Snapshot() Info

Snapshot returns the process identity from ldflags plus the Go runtime version. Dirty is true when Version was stamped with git describe --dirty.

Jump to

Keyboard shortcuts

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