semver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Segment

type Segment int

Segment represents either patch, minor, major numbers is a semantic version.

const (
	// Patch is the patch number in a semantic version.
	Patch Segment = iota
	// Minor is the minor number in a semantic version.
	Minor
	// Major is the major number in a semantic version.
	Major
)

type SemVer

type SemVer struct {
	Major      uint
	Minor      uint
	Patch      uint
	Prerelease []string
	Metadata   []string
}

SemVer represents a semantic versioning

func Parse

func Parse(version string) (SemVer, error)

Parse reads a semantic version string and returns a SemVer.

func (SemVer) GitTag

func (v SemVer) GitTag() string

GitTag returns a semantic version string to be used as a git tag.

func (SemVer) Release

func (v SemVer) Release(segment Segment) (SemVer, SemVer)

Release returns the current and next semantic versions for a release

func (SemVer) Version

func (v SemVer) Version() string

Version returns a semantic version string.

Jump to

Keyboard shortcuts

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