version

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

pkg/version

version exposes the build-time version string injected via ldflags. The three variables are always present — they default to dev / none / unknown for local builds.

fmt.Println(version.String())  // "v1.2.3 (commit: abc1234, built: 2026-05-01T10:00:00Z)"
fmt.Println(version.Short())   // "v1.2.3"

Setting version at build time

go build -ldflags "
  -X github.com/orkspace/orkestra/pkg/version.Version=v1.2.3
  -X github.com/orkspace/orkestra/pkg/version.Commit=$(git rev-parse --short HEAD)
  -X github.com/orkspace/orkestra/pkg/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
" ./cmd/ork

The Makefile injects these automatically when building release binaries.

Documentation

Overview

pkg/version/version.go

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

These variables are set at build time via ldflags:

-X github.com/orkspace/orkestra/pkg/version.Version=v1.0.0
-X github.com/orkspace/orkestra/pkg/version.Commit=abc1234
-X github.com/orkspace/orkestra/pkg/version.Date=2026-03-19T10:00:00Z

Functions

func Short

func Short() string

Short returns just the version tag.

func String

func String() string

String returns the full version string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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