version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version reports the build's identity.

The values are injected at link time by the release build. A binary built any other way reports "dev", which is the honest answer: a development build is not a release and should not claim a version number that implies one.

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
	Date    string
}

Info describes the running binary.

func Get

func Get() Info

Get reports the build's identity, falling back to what the Go toolchain stamped into the binary. A `go install`ed binary carries its module version and VCS revision even with no ldflags, so reading them is what keeps those builds identifiable rather than uniformly "dev".

func (Info) String

func (i Info) String() string

String renders the build for a --version flag.

Jump to

Keyboard shortcuts

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