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

version

package
v0.5.3-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package version exposes build metadata embedded into the binary at link time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WantsHelp

func WantsHelp(args []string) bool

WantsHelp reports whether args ask for usage help. Like WantsVersion, it lets the config-less companion daemons (leoflow-server / -agent) answer `--help` with a usage message and exit 0, instead of falling through to a boot attempt that errors on missing config. Accepts the conventional `-h`, `-help`, and `--help`; exact match, no substring.

func WantsVersion

func WantsVersion(args []string) bool

WantsVersion reports whether args ask for the version (and nothing else runs). It accepts `version`, `-version`, and `--version` so the long-running companion binaries (leoflow-server / -agent / -mcp) can answer "what version are you?" without a full runnable config — checked before any config load or network connect. Kept deliberately narrow (no `-v`, which conventionally means verbose) and exact (no substring match).

Types

type Info

type Info struct {
	Version   string `json:"version"`
	GitCommit string `json:"git_commit"`
	BuildDate string `json:"build_date"`
	GoVersion string `json:"go_version"`
}

Info holds build metadata describing how the binary was produced.

func Get

func Get() Info

Get returns the build metadata embedded at link time, augmented with the Go runtime version the binary was compiled with.

func (Info) String

func (i Info) String() string

String returns a single-line, human-readable rendering of the build metadata.

Jump to

Keyboard shortcuts

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