semver

package
v0.94.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package semver compares release versions well enough for lich's update checks: MAJOR.MINOR.PATCH plus the SemVer rules that a pre-release precedes the release it qualifies and that two pre-releases order identifier by identifier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPreRelease added in v0.93.0

func IsPreRelease(v string) bool

IsPreRelease reports whether v is a pre-release lich tags, a release version followed by a label and its number (0.93.0-rc.15). The "-N-gSHA" that git describe emits between tags is not one.

func IsRelease

func IsRelease(v string) bool

IsRelease reports whether v is a MAJOR.MINOR.PATCH release version, with no pre-release suffix. A dev build ("dev", or the "-N-gSHA" that git describe emits between tags) is not a release, so the update check must not treat it as one. Build metadata ("+local.3") is ignored, as it carries no precedence (SemVer §10): a build of a release that only labels itself is that release, and is offered the next one.

func Less

func Less(a, b string) bool

Less reports whether version a is strictly older than b. Missing or non-numeric components sort as 0, a pre-release sorts before the release it qualifies (SemVer §11: 1.0.0-rc1 < 1.0.0), and two pre-releases of the same version compare identifier by identifier (1.0.0-rc.2 < 1.0.0-rc.10).

Types

This section is empty.

Jump to

Keyboard shortcuts

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