build

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 3 Imported by: 0

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