vers

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package vers implements lenient version parsing and comparison that tolerates semver, Python versions (1.2.3.post1), Go pseudo-versions, and other real-world strings found in lockfiles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b string) int

Compare returns -1, 0, or 1. Non-parseable versions compare as strings.

Types

type Level

type Level int

Level classifies the significance of a version change.

const (
	None Level = iota
	Patch
	Minor
	Major
	Unknown // versions not comparable numerically
)

func Delta

func Delta(oldV, newV string) Level

Delta classifies the jump from old to new.

func (Level) String

func (l Level) String() string

Jump to

Keyboard shortcuts

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