version

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package version exposes build-time version metadata.

Values are injected at release time via -ldflags:

go build -ldflags "\
  -X github.com/RoninForge/budgetclaw/internal/version.version=v0.1.0 \
  -X github.com/RoninForge/budgetclaw/internal/version.commit=$(git rev-parse HEAD) \
  -X github.com/RoninForge/budgetclaw/internal/version.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)"

When the binary is built without ldflags (e.g. `go run`, `go install` from source, or unit tests), Get falls back to runtime/debug.ReadBuildInfo so developers still see useful data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   string
	Commit    string
	BuildDate string
}

Info describes a built binary.

func Get

func Get() Info

Get returns build metadata, preferring ldflags-injected values and falling back to runtime/debug.ReadBuildInfo for source builds.

Jump to

Keyboard shortcuts

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