semver

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonical

func Canonical(v string) (canonical string, err error)

Canonical will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) Use CanonicalWithGoPrefix() if you want the 'v' prefix for compatibility with golang.org/x/mod/semver

func CanonicalWithGoPrefix

func CanonicalWithGoPrefix(v string) (canonical string, err error)

CanonicalWithGoPrefix will return the canonical form of the version with the .MAJOR .MINOR and .PATCH whilst discarding build information It will return an error if the version is not valid semver (unlike Canonical() in golang.org/x/mod/semver) It will prepend 'v' if necessary for compatibility with 'golang.org/x/mod/semver'. Use Canonical() if you don't want the 'v' prefix

func SanitiseVersionMajor

func SanitiseVersionMajor(version string) (majorMinor string, err error)

SanitiseVersionMajor will return the major part of the version with the 'v' prefix

func SanitiseVersionMajorMinor

func SanitiseVersionMajorMinor(version string) (majorMinor string, err error)

SanitiseVersionMajor will return the major and minor parts of the version with the 'v' prefix

func TrimGoPrefix

func TrimGoPrefix(v string) string

TrimGoPrefix will trim the 'v' prefix from a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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