Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(versions []Version)

Sort sorts a slice of versions

Types

type Version

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

Version represents a version.

func Make

func Make(s string) (Version, error)

Make takes a string and converts it to a version. It supports the following: * 1.2.3 * 1.2 * 1 * v1.2.3 * 1.2.3-build-1

func (Version) LT

func (v Version) LT(o Version) bool

LT checks if v is less than o.

func (Version) String

func (v Version) String() string

type Versions

type Versions []Version

Versions represents multiple versions.

func (Versions) Len

func (s Versions) Len() int

Len returns length of version collection

func (Versions) Less

func (s Versions) Less(i, j int) bool

Less checks if version at index i is less than version at index j

func (Versions) Swap

func (s Versions) Swap(i, j int)

Swap swaps two versions inside the collection by its indices

Jump to

Keyboard shortcuts

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