versionutil

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 3 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b *Version) int

Negative when a sorts before b, positive when after, zero when they are the same version

Types

type ParseError

type ParseError struct {
	Text string
}

Error of text that is not a version, carrying the text

func (*ParseError) Error

func (e *ParseError) Error() string

The rejected text, as in invalid version "1.0-"

type Version

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

Parsed release label of a package: an epoch, dotted release numbers, an optional a/b/rc pre-release, post-release and dev-release, and a local label

func Parse

func Parse(text string) (*Version, error)

Version of text with surrounding blanks, a leading v, letter case and separator spelling forgiven, a *ParseError when it is none

func (*Version) String

func (v *Version) String() string

Normalized text of the version, as in 1!2.0rc1.post2.dev3+ubuntu.1

Jump to

Keyboard shortcuts

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