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

buildinfo

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package buildinfo holds the version, build time and release channel the build scripts inject, for the CLI and the admin version endpoint. It is kept apart from the composition root so both can import it.

Index

Constants

View Source
const (
	ChannelStable  = "stable"
	ChannelBeta    = "beta"
	ChannelNightly = "nightly"
	ChannelDev     = "dev"
)

Release channels. A build that does not have Channel injected is a local developer build.

Variables

View Source
var (
	Version   = "unknown version"
	BuildTime = "unknown time"
	// Channel names the release channel this binary was built for. Every build
	// path injects it alongside Version; never infer the channel from the shape
	// of the version string.
	Channel = ChannelDev
)

The build metadata, injected with -ldflags -X at build time.

Functions

func ChannelLabel

func ChannelLabel(channel string) string

ChannelLabel returns the suffix shown next to the version for builds that did not come from the stable channel. Stable builds carry no suffix.

func Display

func Display() string

Display returns the version string the CLI and the admin API show operators. The channel comes from Channel and never from the shape of Version: the release pipelines strip the tag's leading "v", so classifying a build by that prefix reported every published release as a development build.

Types

This section is empty.

Jump to

Keyboard shortcuts

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