buildinfo

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package buildinfo exposes metadata embedded by the Go linker at build time.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Overridden via -ldflags -X at release build time.
	Version     = "dev"
	Commit      = "unknown"
	BuildDate   = "unknown"
	ReleaseDate = ""
)

Functions

func NormalizeVersion

func NormalizeVersion(v string) string

NormalizeVersion ensures release versions are "vX.Y.Z". Leaves "dev" and already-prefixed values unchanged.

Types

type Info

type Info struct {
	Version     string `json:"version"`
	Commit      string `json:"commit"`
	BuildDate   string `json:"build_date"`
	ReleaseDate string `json:"release_date,omitempty"`
}

Info is safe-to-print build metadata.

func Current

func Current() Info

Current returns embedded build metadata. Version is normalized to include a leading "v" for release/update metadata; the public root --version display removes that prefix for human-readable output.

func (Info) IsDevelopment

func (info Info) IsDevelopment() bool

IsDevelopment reports whether this is a local/dev build.

Jump to

Keyboard shortcuts

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