version

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: 0 modules, 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 version identifies the running build.

A daemon installed by `outpost install` can run unattended for months. When it misbehaves the first question is which binary is actually running, and answering it should not require guessing from file timestamps.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string
	Commit  string
	Date    string
)

Set at link time by the release build:

go build -ldflags "-X github.com/sroberts/outpost/internal/version.Version=v1.2.3"

Left empty by a plain `go build`, which falls back to the VCS stamp the Go toolchain embeds on its own — so even an unreleased local build identifies itself rather than claiming to be nothing in particular.

Functions

func Short

func Short() string

Short is the one-line identity used on the wire, where the daemon and the CLI compare builds.

Types

type Info

type Info struct {
	Version string
	Commit  string
	Date    string
	// Dirty reports that the working tree had uncommitted changes at build
	// time, which makes Commit an approximation rather than an identity.
	Dirty bool
	// DateIsCommit distinguishes the two things Date can be. With no link-time
	// stamp the only timestamp available is the commit's, and calling that a
	// build date would mislead whoever is reading it during an incident.
	DateIsCommit bool
	Go           string
	OS           string
	Arch         string
}

Info is what the binary knows about itself.

func Get

func Get() Info

Get reads the build stamp, preferring link-time values and falling back to what the toolchain recorded.

func (Info) Long

func (i Info) Long() string

Long is the human-facing report for `outpost version`.

func (Info) String

func (i Info) String() string

String is the one-line form, for logs and the daemon banner.

Jump to

Keyboard shortcuts

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