build

package
v0.6.125 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 3 Imported by: 1 module, 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 build carries what the deployment stamps into the binary at link time. Set with -ldflags:

-X github.com/backplane-labs/backplane/pkg/backplane/build.Service=hello
-X github.com/backplane-labs/backplane/pkg/backplane/build.Version=1.2.0
-X github.com/backplane-labs/backplane/pkg/backplane/build.Commit=$(git rev-parse HEAD)
-X github.com/backplane-labs/backplane/pkg/backplane/build.Date=$(date -u +%FT%TZ)

Everything falls back to debug.ReadBuildInfo: Service to the last element of the main package path (".../cmd/hello" -> "hello"), so `go run` works; stamp it for anything deployed.

Index

Constants

This section is empty.

Variables

View Source
var (
	Service string
	Version string
	Commit  string
	Date    string
)

Set by the linker.

View Source
var ErrUnnamed = errors.New("service name unknown: stamp build.Service with -ldflags -X")

ErrUnnamed: no name was stamped, given, or derivable from build info.

Functions

This section is empty.

Types

type Info

type Info struct {
	Service string
	Version string
	Commit  string
	Date    string
}

Info is the resolved build information.

func Get

func Get() Info

Get returns the stamped values, filling gaps from the Go build info.

Jump to

Keyboard shortcuts

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