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.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector notices each replacement of one running executable once.
func NewDetector ¶
NewDetector makes a detector whose clock boundary is the process start.
type Info ¶
Info is the immutable identity carried by this running program.
func (Info) Identity ¶
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.