version

package
v0.0.0-...-8cb9fd9 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package version provides functions for comparing RPM package versions. This implementation is tested for correctness by passing the same inputs to the original implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b Interface) int

Compare compares the version details of two packages. Versions are compared by Epoch, Version and Release in descending order of precedence.

If a is more recent than b, 1 is returned. If a is less recent than b, -1 is returned. If a and b are equal, 0 is returned.

This function does not consider if the two packages have the same name or if either package has been made obsolete by the other.

Types

type Interface

type Interface interface {
	Name() string
	Epoch() int
	Version() string
	Release() string
}

Interface is an interface which holds version information for a single package.

Jump to

Keyboard shortcuts

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