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

buildinfo

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package buildinfo names the build a binary came from. Both binaries report the same string everywhere a version appears: the version subcommand, the startup log line, and the agent's reported version on the sync stream, which the console shows among a workload's host facts.

The string is semantic-version shaped, with the commit as build metadata:

v0.1.0+6007581f652b        a build of a tagged commit
dev+f347cd966f58           a from-source build of an untagged commit
dev+f347cd966f58.dirty     the same, with uncommitted changes
dev+unknown                a build that carries no commit at all

The commit comes from what the Go toolchain embeds on every build made in a git checkout (vcs.revision), so a plain `go build` needs no flags. A release build may set both values at link time instead:

-ldflags "-X github.com/innerwall-dev/innerwall/internal/buildinfo.version=v0.1.0
          -X github.com/innerwall-dev/innerwall/internal/buildinfo.commit=<sha>"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version is this binary's version string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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