buildinfo

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 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 what a binary was built from, for the commands' version subcommand and --version flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Version is the release version (stamped with -ldflags at release
	// builds, without "v"), else the module version Go recorded (a tag,
	// for go install), else "(devel)" or "unknown".
	Version string
	// Commit is the Git commit (vcs.revision, or stamped with -ldflags
	// where the build has no .git, as for the images), else "unknown".
	Commit string
	// Modified: built from a checkout with local changes.
	Modified bool
	// Go is the Go version the binary was built with; Platform is
	// GOOS/GOARCH.
	Go, Platform string
}

Info is what a binary was built from.

func Get

func Get(version, commit string) Info

Get reports the running binary; version and commit are the -ldflags values (empty when not stamped), which win over the build info.

func (Info) String

func (i Info) String(name string) string

String is what the version subcommand prints for the command name.

Jump to

Keyboard shortcuts

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