version

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(v, w string) int

CompareVersions returns an integer comparing two versions according to semantic version precedence.

func FormatVersionString

func FormatVersionString(version string, prefixWanted bool) string

FormatVersionString adds or removes a "v" prefix from version string.

Types

type Info

type Info struct {
	Version string `json:"version" yaml:"version"`
	Commit  string `json:"commit" yaml:"commit"`
	Date    string `json:"date" yaml:"date"`
}

Info holds the concrete version information.

func NewInfo

func NewInfo(v, c, d string) Info

NewInfo creates a new Info instance.

func (Info) Compare

func (i Info) Compare(other string) int

func (Info) GetCommit

func (i Info) GetCommit() string

func (Info) GetDate

func (i Info) GetDate() string

func (Info) GetVersion

func (i Info) GetVersion() string

func (Info) IsDevelopment

func (i Info) IsDevelopment() bool

func (Info) String

func (i Info) String() string

type Version

type Version interface {
	GetVersion() string
	GetCommit() string
	GetDate() string
	String() string
	Compare(other string) int
	IsDevelopment() bool
}

Version defines the interface for project version information.

Jump to

Keyboard shortcuts

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