semver

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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 rule that a pre-release precedes the release it qualifies. It does not order two distinct pre-releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRelease

func IsRelease(v string) bool

IsRelease reports whether v is a plain MAJOR.MINOR.PATCH release version — no pre-release or build-metadata 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.

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, and a pre-release sorts before the release it qualifies (SemVer §11: 1.0.0-rc1 < 1.0.0).

Two different pre-releases of the same version compare equal (rc.1 vs rc.2 is not ordered): that would need identifier-wise comparison, and the update check only ever weighs a build against GitHub's "latest" release, which never resolves to a pre-release.

Types

This section is empty.

Jump to

Keyboard shortcuts

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