version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: GPL-3.0 Imports: 1 Imported by: 5

Documentation

Overview

Package version exposes the version of the tool that imports it.

Every katbyte tool reports a version the same way: stamped by the linker at release time, falling back to the module version Go records when the tool was installed with `go install ...@version`, and "dev" for a plain local build. Keeping that logic here means each tool's goreleaser and makefile stamp the same two variables:

-X github.com/katbyte/go-kt/version.Version={{ .Tag }}
-X github.com/katbyte/go-kt/version.GitCommit={{ .ShortCommit }}

The variables live in this module, but ReadBuildInfo reports the *main* module's version, so a tool built from go-kt still reports its own tag.

Index

Constants

This section is empty.

Variables

View Source
var GitCommit string

GitCommit is the short commit hash the binary was built from, set at build time with -X. It is empty for builds that do not stamp it, which is fine: it only ever decorates the version string.

View Source
var Version = "dev"

Version is the release version. It is set at build time with -X, otherwise taken from the main module's build info, otherwise "dev". It is never blank: an -X flag given an empty value has happened before and must not produce a tool that reports no version at all.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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