version

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "dev"
	Commit    = "unknown"
	BuildDate = "unknown"
	GoVersion = runtime.Version()
)

Version information - set at build time via ldflags

Functions

func Compare

func Compare(v1, v2 string) int

Compare compares two version strings Returns -1 if v1 < v2, 0 if v1 == v2, 1 if v1 > v2

Types

type Info

type Info struct {
	Version      string `json:"version"`
	Commit       string `json:"commit"`
	BuildDate    string `json:"build_date"`
	GoVersion    string `json:"go_version"`
	Platform     string `json:"platform"`
	OS           string `json:"os"`
	Arch         string `json:"arch"`
	NumCPU       int    `json:"num_cpu"`
	NumGoroutine int    `json:"num_goroutine"`
	GitBranch    string `json:"git_branch,omitempty"`
	GitTag       string `json:"git_tag,omitempty"`
}

Info holds complete version information

func Get

func Get() Info

Get returns version information

func GetExtended

func GetExtended() Info

GetExtended returns version information with git details from debug info

func (Info) IsDev

func (i Info) IsDev() bool

IsDev returns true if this is a development build

func (Info) IsRelease

func (i Info) IsRelease() bool

IsRelease returns true if this is a release build

func (Info) Short

func (i Info) Short() string

Short returns a short version string

func (Info) String

func (i Info) String() string

String returns a formatted version string

Jump to

Keyboard shortcuts

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