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. See the Makefile for the exact invocation.
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`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.