bump

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	None  = Type(0)
	Patch = Type(1)
	Minor = Type(2)
	Major = Type(3)
)
View Source
const (
	NoneName  = Name("none")
	PatchName = Name("patch")
	MinorName = Name("minor")
	MajorName = Name("major")
)

Variables

View Source
var ErrNameNotValid = errors.New("name introduced is not valid")

Functions

func Bump

func Bump(version *semver.Version, bt Type) *semver.Version

Bump returns a new version after bumping it according to the specified bump bump.

Types

type Name

type Name string

type Type

type Type int

func From

func From(previous, current *semver.Version) Type

From deduces the bump that caused the old version to go to the new.

func NameToType

func NameToType(name string) (Type, error)

NameToType returns the bump type from a string. The string should be from a constant constant of bump.Name or it will return bump.None.

func (Type) Cap

func (bt Type) Cap(other Type) Type

Cap returns the current bump if it is smaller or equal than another one, and second otherwise. e.g Major.Cap(Minor) returns Minor, and Patch.Cap(Minor) returns Patch.

func (Type) Less

func (bt Type) Less(other Type) bool

Less returns whether the current bump Type is smaller than another one.

func (Type) With

func (bt Type) With(other Type) Type

With composes two bump types, returning the largest of the two.

Jump to

Keyboard shortcuts

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