Help us shape the future of Go! Take the 2026 Go Developer Survey

semver

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: ISC Imports: 4 Imported by: 0

Documentation

Overview

Package semver provides functionalities for working with semantic versions. For more information about semantic versioning, visit https://semver.org.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SemVer

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

SemVer represents a semantic version.

func Parse

func Parse(semver string) (SemVer, bool)

Parse gets a semantic version string and returns a SemVer. If the second return value is false, it implies that the input semver was incorrect.

func (SemVer) Next

func (v SemVer) Next() SemVer

Next creates a new semantic version by increasing the patch version by one.

func (SemVer) ReleaseMajor

func (v SemVer) ReleaseMajor() SemVer

ReleaseMajor creates a new semantic version for a major release.

func (SemVer) ReleaseMinor

func (v SemVer) ReleaseMinor() SemVer

ReleaseMinor creates a new semantic version for a minor release.

func (SemVer) ReleasePatch

func (v SemVer) ReleasePatch() SemVer

ReleasePatch creates a new semantic version for a patch release.

func (SemVer) String

func (v SemVer) String() string

String returns the string representation of the current semantic version.

func (SemVer) TagName

func (v SemVer) TagName() string

TagName returns a git tag name for the current semantic version.

Jump to

Keyboard shortcuts

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