semver

package
v3.0.0-alpha2.113 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package semver provides simple semantic version parsing and comparison. Implements a subset of the Semantic Versioning 2.0.0 spec sufficient for the wails version-check use cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Major      uint64
	Minor      uint64
	Patch      uint64
	Prerelease string
	Metadata   string
}

Version represents a parsed semantic version.

func NewVersion

func NewVersion(s string) (*Version, error)

NewVersion parses a semver string such as "1.2.3", "1.2.3-beta.1", or "v1.2.3".

func (*Version) Equal

func (v *Version) Equal(other *Version) bool

Equal reports whether v == other (metadata ignored).

func (*Version) GreaterThan

func (v *Version) GreaterThan(other *Version) bool

GreaterThan reports whether v > other.

func (*Version) GreaterThanOrEqual

func (v *Version) GreaterThanOrEqual(other *Version) bool

GreaterThanOrEqual reports whether v >= other.

func (*Version) LessThan

func (v *Version) LessThan(other *Version) bool

LessThan reports whether v < other.

func (*Version) String

func (v *Version) String() string

String returns the canonical string representation.

Jump to

Keyboard shortcuts

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