Documentation
¶
Overview ¶
Package semver provides functionality for parsing, comparing, and manipulating semantic version strings according to the SemVer 2.0.0 spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveNext ¶
func DeriveNext(highestChange ChangeLevel, currentVersion string) (string, error)
DeriveNext calculates the next version based on the highest change type and current version.
func MaxVersion ¶
MaxVersion returns the largest semantic version string among the provided version strings.
Types ¶
type ChangeLevel ¶
type ChangeLevel int
ChangeLevel represents the level of change, corresponding to semantic versioning.
const ( // None indicates no change. None ChangeLevel = iota // Patch is for backward-compatible bug fixes. Patch // Minor is for backward-compatible new features. Minor // Major is for incompatible API changes. Major )
func (ChangeLevel) String ¶
func (c ChangeLevel) String() string
String converts a ChangeLevel to its string representation.
type Version ¶
type Version struct {
Major, Minor, Patch int
// Prerelease is the non-numeric part of the prerelease string (e.g., "alpha", "beta").
Prerelease string
// PrereleaseSeparator is the separator between the pre-release string and
// its version (e.g., ".").
PrereleaseSeparator string
// PrereleaseNumber is the numeric part of the pre-release string (e.g., "1", "21").
PrereleaseNumber string
}
Version represents a semantic version.
Click to show internal directories.
Click to hide internal directories.