version

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version exposes the build-time version of typeburn.

Version, Commit and Date are injected by the linker via

-ldflags "-X github.com/bavanchun/Typeburn/internal/version.Version=..."

(wired in the Makefile and .goreleaser.yaml). When they are not set — for example after `go install github.com/bavanchun/Typeburn@v1.0.0`, which applies no ldflags — Resolve falls back to the module build information the Go toolchain embeds in every binary.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version string
	Commit  string
	Date    string
)

ldflags-injection targets. Keep these as plain package-level string vars: the linker's -X only rewrites simple string variables.

Functions

func String

func String() string

String resolves the build info and renders the one-line banner.

Types

type Info

type Info struct {
	Version string
	Commit  string
	Date    string
}

Info is a fully resolved version triple ready for display.

func Resolve

func Resolve() Info

Resolve returns the effective version information.

Precedence: ldflags-injected values win. Any field left empty is filled from debug.ReadBuildInfo() — Main.Version for the version (ignoring the synthetic "(devel)"), and the vcs.revision / vcs.time build settings for commit/date. If the version is still unknown the final fallback is "dev". It never panics.

func (Info) String

func (i Info) String() string

String renders a single-line banner, e.g.

typeburn v1.0.0 (61a4afd, 2026-05-18T21:10:00Z, go1.26.2 darwin/arm64)

Jump to

Keyboard shortcuts

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