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

version

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CapDBDryRunSafe = "db-dry-run-safe"

CapDBDryRunSafe is advertised by builds whose `db migrate up --dry-run` (with or without --migration-dir) issues only read statements and applies nothing (P7-PROD-77, P7-PROD-84). A caller that forwards --dry-run to a remote nself must see it in that remote's `nself version --json` first: the version number cannot prove it, because source builds and the released v1.4.12 both report 1.4.12 and v1.4.12 applies on a dry-run.

Variables

View Source
var (
	Version   string = "1.4.13"
	Commit    string = "unknown"
	BuildDate string = "unknown"
)

Version, Commit, and BuildDate are set via ldflags at build time.

go build -ldflags "-X nself/internal/version.Version=1.0.0 -X nself/internal/version.Commit=abc123 -X nself/internal/version.BuildDate=2026-01-01"

Functions

func Capabilities added in v1.4.13

func Capabilities() []string

Capabilities lists the capability names this build advertises in `nself version --json`. Add a name only with the change that earns it.

func GetBuildDate

func GetBuildDate() string

GetBuildDate returns the build date.

func GetCommit

func GetCommit() string

GetCommit returns the git commit hash.

func GetVersion

func GetVersion() string

GetVersion returns the build version string.

func NextMinor added in v1.3.0

func NextMinor(v string) string

NextMinor returns the next minor release version (patch reset to 0) for a "X.Y.Z" version string, e.g. "1.2.7" -> "1.3.0". Used for escape-hatch removal-version messaging such as NSELF_LEGACY_ENV_ORDER (CLI-R18), which is honored for exactly one minor version. Returns v unchanged if it cannot be parsed as three dot-separated integers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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