version

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version provides build-time version information for the Nexus CLI.

The variables in this package are populated at compile time via -ldflags:

go build -ldflags "-X github.com/Gamingstein/nexus/internal/version.Version=1.0.0
  -X github.com/Gamingstein/nexus/internal/version.Commit=abc1234
  -X github.com/Gamingstein/nexus/internal/version.BuildTime=2025-01-01T00:00:00Z"

If not set, they default to "dev", "unknown", and "unknown" respectively. The Info() function returns a formatted multi-line string suitable for display in the `nexus version` command.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version tag (e.g., "v0.1.0" or "dev").
	Version = "dev"

	// Commit is the short git commit hash (e.g., "abc1234").
	Commit = "unknown"

	// BuildTime is the UTC timestamp of when the binary was built.
	BuildTime = "unknown"
)

These variables are set at build time via -ldflags -X. If not set, they are automatically populated via debug.ReadBuildInfo when installed via `go install`.

Functions

func GoVersion

func GoVersion() string

GoVersion returns the Go version used to compile the binary.

func Info

func Info() string

Info returns a formatted multi-line string with all build information. This is the output displayed by `nexus version`.

func Platform

func Platform() string

Platform returns the OS/architecture string (e.g., "darwin/arm64").

func Short

func Short() string

Short returns a compact one-line version string.

Example: "nexus v0.1.0 (abc1234)"

Types

This section is empty.

Jump to

Keyboard shortcuts

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