buildinfo

package
v0.62.1 Latest Latest
Warning

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

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

Documentation

Overview

Package buildinfo resolves the running WB binary's version so that any package can record it, not just the command layer.

The version lives in three places depending on how the binary was produced: a release build stamps it via -ldflags, a `go install` of the module leaves it in the embedded build info, and an ad-hoc build has neither. Resolving that order in one place keeps `wb version` and the provenance WB writes into worktrees from ever disagreeing about which binary is running.

Index

Constants

View Source
const Unknown = "unknown"

Unknown is reported when no version can be resolved at all.

Variables

This section is empty.

Functions

func Set

func Set(v string)

Set records the link-time version. The command layer calls it during start-up so the release stamp takes precedence over embedded build info.

func Version

func Version() string

Version returns the link-time stamp, else the module version the Go toolchain embedded, else Unknown. It never returns an empty string, so callers can record it unconditionally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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