versionutil

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const NoCommit = "NOCOMMIT"
View Source
const NoSemver = "NOSEMVER"

Variables

View Source
var Semver string = NoSemver

Functions

func CompareVersions

func CompareVersions(v1, v2 Version) int

CompareVersions compares two Version structs based on their Semver fields. It returns -1 if v1 < v2, 0 if v1 == v2, and 1 if v1 > v2. If either version has NoSemver, it returns 2.

Types

type Version

type Version struct {
	GitCommit string
	Semver    string
	GoVersion string
	BuildDate string
}

func GetVersion

func GetVersion() *Version

func NewVersion

func NewVersion(gitCommit, goVersion, buildDate string) *Version

func (*Version) VersionString

func (v *Version) VersionString() string

Jump to

Keyboard shortcuts

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