buildinfo

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: 0BSD Imports: 2 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 which commit a binary was built from, so a deployed artifact can state its provenance instead of needing a rebuild and a hash comparison to infer it.

Index

Constants

This section is empty.

Variables

View Source
var Commit string

Commit is stamped at link time by the Makefile:

-X gitbay.org/gitbay/internal/buildinfo.Commit=<sha>

It carries a -dirty suffix when the tree was not clean, which only happens under ALLOW_DIRTY=1 since preflight otherwise refuses to build.

Functions

func Identified

func Identified() bool

Identified reports whether this build can be traced back to a commit that exists in history. A dirty or missing stamp means it cannot: the tree it was built from was never committed, so nothing can say what is running.

func String

func String() string

String returns the build's commit. A binary built by hand rather than by the Makefile has no stamp, so fall back to the revision the toolchain embeds; that one is absent too when the build ran outside a checkout.

Types

This section is empty.

Source Files

  • buildinfo.go

Jump to

Keyboard shortcuts

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