version

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version resolves the build version shown in the CLI banner and by `a-novel version`.

Resolution order (first non-empty wins):

  1. The ldflags-injected Version var — set by release builds with -X github.com/a-novel-kit/stack/cli/internal/version.Version=v1.2.3
  2. The module version recorded by `go install module@vX.Y.Z` (debug.ReadBuildInfo → Main.Version).
  3. The VCS revision baked in by the Go toolchain for `go build` inside a git checkout (short commit, suffixed "-dirty" when the tree is modified).
  4. The literal "dev" when nothing else is available.

Index

Constants

This section is empty.

Variables

View Source
var Version = ""

Version is intentionally a plain var (not a const) so release pipelines can override it at link time without touching source. Leave it empty here — an empty value means "fall back to build info", which keeps local `go run` and `go install @latest` honest about what they actually are.

Functions

func String

func String() string

String returns the resolved version string, e.g. "v2.1.0", "a1b2c3d-dirty", or "dev". It never returns an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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