dpkgversion

package
Version: v0.0.0-...-c88c75b Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

dpkgversion is a pure-go implementation of dpkg version string functions (parsing, comparison) which is compatible with dpkg(1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a Version, b Version) int

Compare compares the two provided Debian versions. It returns 0 if a and b are equal, a value < 0 if a is smaller than b and a value > 0 if a is greater than b.

Types

type Version

type Version struct {
	Epoch    uint
	Version  string
	Revision string
}

func Parse

func Parse(input string) (Version, error)

Parse returns a Version struct filled with the epoch, version and revision specified in input. It verifies the version string as a whole, just like dpkg(1), and even returns roughly the same error messages.

func (Version) String

func (v Version) String() string

Source Files

Jump to

Keyboard shortcuts

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