buildinfo

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package buildinfo resolves the version embedded in a Gloss binary.

Index

Constants

View Source
const DevelopmentVersion = "dev"

Variables

View Source
var InjectedVersion string

InjectedVersion is set only by tagged release builds:

go build -ldflags "-X github.com/Architeg/gloss/internal/buildinfo.InjectedVersion=v1.2.3"

Functions

func Display

func Display(version string) string

Display adds the conventional v prefix to stable versions while leaving development labels unchanged.

func NormalizeStable

func NormalizeStable(value string) (string, bool)

NormalizeStable accepts a stable three-component semantic version with an optional leading v and returns the canonical version without that prefix.

func Resolve

func Resolve(injected string, info *debug.BuildInfo) string

Resolve applies the release-injection, module-build-info, development fallback order. It is exported so tests can use synthetic build metadata without mutating process-global state.

func ValidateReleaseTag

func ValidateReleaseTag(tag string) (string, error)

ValidateReleaseTag requires the exact stable release-tag form vX.Y.Z.

func Version

func Version() string

Version returns the canonical version for the running binary without a leading v. Untagged local builds return DevelopmentVersion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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