version

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Overview

Package version reads version metadata from the running binary's build info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	ModulePath  string // debug.BuildInfo.Main.Path
	Version     string // debug.BuildInfo.Main.Version, verbatim
	IsRelease   bool   // true iff Version is a clean, tagged semver
	GoVersion   string // debug.BuildInfo.GoVersion
	VCSRevision string // from BuildInfo.Settings["vcs.revision"], if present
	VCSDirty    bool   // from BuildInfo.Settings["vcs.modified"], if present
}

Info holds version metadata read from the running binary's build info. See TAD §18.1 for the full contract.

func Current

func Current() Info

Current reads the running binary's own build metadata via runtime/debug.ReadBuildInfo(). Never makes a network call, never reads files, never shells out to git. Returns a zero Info on error (e.g. when build info is stripped). See TAD §18.1 for the full contract.

Jump to

Keyboard shortcuts

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