version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// This will be set during build time via -ldflags.
	Version = "dev"

	// This will be set during build time via -ldflags.
	Commit = "unknown"

	// This will be set during build time via -ldflags.
	Date = "unknown"
)

Functions

func ValidateVersion

func ValidateVersion()

If version is not "dev", it must be a valid semantic version or the program will crash.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"go_version"`
	Platform  string `json:"platform"`
}

Info contains version information.

func Get

func Get() Info

Get returns the current version information.

func (Info) String

func (i Info) String() string

String returns a human-readable version string with version on first line.

Jump to

Keyboard shortcuts

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