version

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package version provides build information for the spectr binary.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the build.
	Version = "dev"

	// Commit is the git commit hash of the build.
	Commit = "unknown"

	// Date is the timestamp when the binary was built.
	Date = "unknown"
)

Build information variables set via ldflags during compilation. Example: go build -ldflags "-X github.com/connerohnesorge/spectr/internal/version.Version=v0.1.0"

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

BuildInfo contains version and build metadata.

func GetBuildInfo

func GetBuildInfo() BuildInfo

GetBuildInfo returns the current build information.

func (BuildInfo) JSON

func (b BuildInfo) JSON() ([]byte, error)

JSON returns the build info as JSON bytes.

func (BuildInfo) Short

func (b BuildInfo) Short() string

Short returns just the version string.

func (BuildInfo) String

func (b BuildInfo) String() string

String returns a formatted multi-line representation of build info.

Jump to

Keyboard shortcuts

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