buildinfo

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package buildinfo reports build-time metadata. Release builds inject exact values via -ldflags (GoReleaser); local/dev builds (the dev wrapper, `go build`) have none, so we recover what we can from the embedded VCS stamp (commit + dirty flag) and the binary's own mtime as the build time. Because the dev wrapper rebuilds on every launch, that mtime makes each dev build uniquely identifiable — so a boot banner can tell you exactly which build is running.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

These are overridden at release time, e.g.:

-X github.com/memcode-ai/memcode/internal/buildinfo.Version=1.2.3
View Source
var DevBuild = ""

DevBuild is stamped "1" by the dev wrapper's ldflags. Default is OFF, so a release build (or any build that forgets the flag) can never accidentally show dev diagnostics.

Functions

func Compact

func Compact() string

Compact is the build identifier for the always-on footer — always a REAL version. A clean release shows just its semver (e.g. "1.2.3"); a dev build shows the synthesized baseVersion-dev+commit (e.g. "0.1.0-dev+a1b2c3d-dirty"), where the commit is the per-build identifier. No build timestamps — the footer carries a version, not a clock.

func IsDev

func IsDev() bool

IsDev reports whether this is a local/dev build: the dev wrapper stamps DevBuild=1 (it also stamps a real semver, so Version alone can't tell), and a bare `go build` has no ldflags at all (Version stays "dev").

func Short

func Short() string

Short is a compact identifier — "dev · a1b2c3d-dirty · built 11:02:05" — enough to tell two builds apart at a glance.

func String

func String() string

String is the full one-line version summary (for `memcode version`).

Types

This section is empty.

Jump to

Keyboard shortcuts

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