buildinfo

package
v0.2.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package buildinfo names the source and moment that produced this codeaf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dirty

func Dirty() bool

Dirty reports whether the running binary was built from a modified tree, read from the same build settings Identity derives from. Callers that need the build's honesty — telemetry's opt-out ladder — ask here rather than parsing a display string.

func Identity

func Identity() string

Identity names the engine this process is. Info.Identity is the rule.

func Revision

func Revision() string

Revision returns the stable source identity without the build-time details.

func StaleNotice

func StaleNotice() string

StaleNotice reports when this process's executable has been replaced.

func String

func String() string

String returns the compact build identity shown to a person and kept on disk.

Types

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector notices each replacement of one running executable once.

func NewDetector

func NewDetector(path string, started time.Time) *Detector

NewDetector makes a detector whose clock boundary is the process start.

func (*Detector) Notice

func (detector *Detector) Notice() string

Notice returns one calm restart sentence for each newer file at path.

type Info

type Info struct {
	Revision string
	Dirty    bool
	BuiltAt  time.Time
}

Info is the immutable identity carried by this running program.

func (Info) Identity

func (info Info) Identity() string

Identity names the engine a running process is, as far as a build can be told from another one.

A BUILD THAT CAN NAME ITS SOURCE IS THAT SOURCE AND NOTHING ELSE. Two `make build` runs on one unmodified commit produce the same program, so they produce the same engine — and the door that decides whether to attach must not read a difference nobody made. It did: the build moment was in here, so a window built thirteen seconds after the engine it met was told it had met an older codeaf.

A BUILD THAT CANNOT NAME ITS SOURCE KEEPS THE MOMENT IT WAS MADE. A modified tree spells the same revision before and after an edit, and an unstamped build spells none at all; the moment is then the only thing that tells one rebuild from the next, and somebody rebuilding what they just edited must still get a new engine.

func (Info) String

func (info Info) String() string

String formats a build identity without inventing absent facts.

Jump to

Keyboard shortcuts

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