version

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package version exposes the gskill build version and source commit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit() string

Commit returns the resolved source commit: the injected value when present, otherwise the VCS revision from the binary's build info (suffixed "+dirty" when the working tree was modified), otherwise an empty string.

func HasVCS added in v0.10.0

func HasVCS() bool

HasVCS reports whether the build info carries any vcs.* setting.

func ModulePath added in v0.10.0

func ModulePath() string

ModulePath returns the main module path from the build info, or "".

func String

func String() string

String returns the human-readable version line, e.g. "gskill dev".

func Version

func Version() string

Version returns the resolved build version: the injected value when present, otherwise the module version embedded in the binary's build info, otherwise "dev".

Types

type BuildKind added in v0.10.0

type BuildKind string

BuildKind says where the running binary's version came from.

const (
	// KindRelease is a binary built by the release pipeline, which injects the
	// version through ldflags.
	KindRelease BuildKind = "release"
	// KindModule is a `go install pkg@version` build: the version comes from the
	// module, and there is no VCS data because it was built from a module zip.
	KindModule BuildKind = "module"
	// KindDevelopment is any other build, such as a local `go build` in a checkout.
	KindDevelopment BuildKind = "development"
)

func Kind added in v0.10.0

func Kind() BuildKind

Kind reports how the binary was built. A local `go build` in a checkout has stamped a module version from VCS since Go 1.24, so only the presence of VCS settings tells it apart from `go install`.

Jump to

Keyboard shortcuts

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