buildinfo

package
v0.10.16 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package buildinfo derives version metadata from ldflags and runtime VCS info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version string
	Commit  string
	Built   string
	Dirty   bool
}

Info holds version metadata for the running binary.

func Read

func Read(ldflagVersion, ldflagCommit, ldflagBuilt string) Info

Read returns best-effort build metadata. ldflag values take precedence; runtime VCS info from debug.ReadBuildInfo() fills any empty fields. For dev builds in git worktrees where the Go toolchain cannot embed VCS settings, it falls back to running git directly.

Jump to

Keyboard shortcuts

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