buildinfo

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 7 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

Index

Constants

View Source
const EnvPrintSelf = "GOFER_PRINT_BUILDINFO"

EnvPrintSelf makes the gofer binary print its own Go build identity as JSON and exit before any CLI handling. A UPX-packed release binary hides its build info section from debug/buildinfo.ReadFile, but once running it unpacks itself and can still report it, so the managed upgrade asks the candidate directly.

Variables

This section is empty.

Functions

func PrintSelfIfRequested

func PrintSelfIfRequested(w io.Writer) bool

PrintSelfIfRequested writes Self to w and reports true when EnvPrintSelf is "1".

Types

type Info

type Info struct {
	Version   string
	GitCommit string
	BuildDate string
}

Info carries linker-injected build metadata from main into lower layers.

func (Info) DisplayVersion

func (i Info) DisplayVersion() string

DisplayVersion returns the compact version string shown by CLI/API surfaces.

type Self

type Self struct {
	Path   string `json:"path"`
	GOOS   string `json:"goos"`
	GOARCH string `json:"goarch"`
}

Self is the build identity a binary reports about itself.

func ParseSelf

func ParseSelf(out []byte) (Self, error)

ParseSelf decodes the output of a binary run with EnvPrintSelf=1.

Jump to

Keyboard shortcuts

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