version

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2026 The GOT Authors. MIT License.

Package version exposes the GOT binary's build-time identity. The Version, Commit, and Date variables are intended to be overridden at build time via:

-ldflags "-X github.com/supunhg/got/internal/version.Version=... \
          -X github.com/supunhg/got/internal/version.Commit=... \
          -X github.com/supunhg/got/internal/version.Date=..."

Index

Constants

This section is empty.

Variables

View Source
var Commit = "none"

Commit is the short git SHA the binary was built from, or "none" if the build did not inject one.

View Source
var Date = "unknown"

Date is the RFC3339 build timestamp, or "unknown" if the build did not inject one.

View Source
var Version = "1.0.0"

Version is the GOT semantic version (e.g. "0.1.0"). Defaults to "dev" for builds that did not inject a value.

Functions

func Matches

func Matches(constraint string) bool

Matches checks whether the current version satisfies the given semver constraint. The constraint format is simple: ">=1.0.0", ">0.5.0", "1.0.0" (exact match). Returns true if version is "dev" (development builds accept any constraint).

func String

func String() string

String returns a human-readable version string of the form:

got 0.1.0 (commit abcdef1, built 2026-06-12T10:00:00Z)

It is the single source of truth for what `--version` and `got version` print. Both call sites route through here so the output stays in sync.

Types

This section is empty.

Jump to

Keyboard shortcuts

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