semver

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SemanticVersion

type SemanticVersion struct {
	// contains filtered or unexported fields
}

func Parse

func Parse(version string) (*SemanticVersion, error)

Parse creates a new SemanticVersion from a version string

func ParseQuietly

func ParseQuietly(version string) *SemanticVersion

ParseQuietly attempts to parse a version string, returning nil if parsing fails

func (SemanticVersion) BuildMetadata

func (s SemanticVersion) BuildMetadata() string

func (SemanticVersion) Compare

func (s SemanticVersion) Compare(other SemanticVersion) int

Compare implements comparison between two semantic versions Returns -1 if s < other, 0 if s == other, and 1 if s > other

func (SemanticVersion) Equal

func (s SemanticVersion) Equal(other SemanticVersion) bool

Equal compares two semantic versions for equality

func (SemanticVersion) Major

func (s SemanticVersion) Major() int

Getters - using value receivers since they don't modify state

func (SemanticVersion) Minor

func (s SemanticVersion) Minor() int

func (SemanticVersion) Patch

func (s SemanticVersion) Patch() int

func (SemanticVersion) Prerelease

func (s SemanticVersion) Prerelease() string

func (SemanticVersion) String

func (s SemanticVersion) String() string

Jump to

Keyboard shortcuts

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