version

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION_PLACEHOLDER = "{{VERSION}}"
View Source
const VERSION_REGEX = `(?P<full>` +
	`(?P<major>0|[1-9]\d*)` +
	`(?:\.(?P<minor>0|[1-9]\d*))?` +
	`(?:\.(?P<patch>0|[1-9]\d*))?` +
	`(?:\.(?P<patch2>0|[1-9]\d*))?` +
	`(?:[.-]?(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` +
	`(?:\+(?P<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?` +
	`)`

VERSION_REGEX inspired from https://semver.org/

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Text       string
	Major      *uint
	Minor      *uint
	Patch      *uint
	Patch2     *uint
	Prerelease string
	Build      string
}

func FromString

func FromString(source string) (*Version, error)

func FromStringCustom

func FromStringCustom(source string, regex string) (*Version, error)

func (Version) FillVersionsPlaceholders

func (version Version) FillVersionsPlaceholders(input string) string

func (Version) IsNewerThan

func (version Version) IsNewerThan(other Version) bool

IsNewerThan could probably be optimized...

func (Version) String

func (version Version) String() string

Jump to

Keyboard shortcuts

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