version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version provides version information for the wherehouse application. Version information follows semantic versioning 2.0 (semver.org).

Build-time injection:

go build -ldflags "\
  -X github.com/asphaltbuffet/wherehouse/internal/version.Version=v0.1.0 \
  -X github.com/asphaltbuffet/wherehouse/internal/version.GitCommit=abc1234 \
  -X github.com/asphaltbuffet/wherehouse/internal/version.BuildDate=2026-02-20T12:34:56Z"

Version format:

Development: v0.1.0-dev+abc1234
Release:     v0.1.0+abc1234

Index

Constants

View Source
const (
	// ApplicationName is the name of the application.
	ApplicationName = "wherehouse"
)

Variables

View Source
var (
	// Version is the semantic version (injected via ldflags).
	// Development default: "v0.1.0-dev".
	// Release builds inject: "v0.1.0".
	Version = "v0.1.0-dev"

	// GitCommit is the git commit hash (short form).
	// Injected via ldflags during build.
	GitCommit = "unknown"

	// BuildDate is the build timestamp (ISO 8601 format).
	// Injected via ldflags during build.
	BuildDate = "unknown"
)

Functions

func BuildInfo

func BuildInfo() string

BuildInfo returns build metadata including commit and timestamp. Format: abc1234 (2026-02-20T12:34:56Z) Returns empty string if no build information available.

func FullVersion

func FullVersion() string

FullVersion returns the complete version string including commit hash. Format: v0.1.0-dev+abc1234 or v0.1.0+abc1234 for releases. This is the primary version string displayed to users.

func ShortVersion

func ShortVersion() string

ShortVersion returns only the semantic version without commit hash. Format: v0.1.0-dev or v0.1.0 for releases. Useful for version comparisons and compatibility checks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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