Help us shape the future of Go! Take the 2026 Go Developer Survey

buildinfo

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package buildinfo reports which build of a hive program is running.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version string
	Commit  string
	Date    string
}

Info is a binary's release identity.

func Resolve

func Resolve(version, commit, date string) Info

Resolve returns the identity a program's -ldflags stamped. A binary built without them (`go install module@version`, `go build`, `go run`) still has version "dev"; Resolve then reads the module version and VCS metadata the Go toolchain records, keeping each stamped value the toolchain has no substitute for.

type VCS

type VCS struct {
	ModuleVersion string
	Revision      string
	Modified      bool
	Time          string
	GoVersion     string
}

VCS is what the Go toolchain stamps into a binary. Revision is empty under -buildvcs=false.

func ReadVCS

func ReadVCS() VCS

ReadVCS reads the toolchain's stamp from the running binary. It is the zero value when the binary carries no build information.

Jump to

Keyboard shortcuts

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