version

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 1 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 exposes build metadata injected at link time via -ldflags -X.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the CLI (e.g. "v1.2.3").
	Version = "dev"
	// Commit is the git commit the binary was built from.
	Commit = "none"
	// Date is the build timestamp (RFC 3339).
	Date = "unknown"
	// InstallSource records how the binary was distributed ("source", "brew",
	// "goreleaser", "go-install"). Later issues (#15/#16) gate self-update on it.
	InstallSource = "source"
)

These variables are overridden at build time. Defaults are chosen so a plain `go build` / `go install` (no ldflags) still produces sensible output.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version       string `json:"version" yaml:"version"`
	Commit        string `json:"commit" yaml:"commit"`
	Date          string `json:"date" yaml:"date"`
	InstallSource string `json:"install_source" yaml:"install_source"`
}

Info bundles the build metadata for rendering.

func Current

func Current() Info

Current returns the build metadata for this binary. When the ldflags were not applied — chiefly `go install github.com/vibexp/cli/cmd/vibexp@<tag>` — it falls back to the module version and VCS stamps embedded by the Go toolchain (debug.ReadBuildInfo), so the version is still reported correctly.

Jump to

Keyboard shortcuts

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