apiversion

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

apiversion

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare added in v0.1.1

func Compare(x, y string) (int, error)

Compare returns an integer comparing two version strings. The result will be 0 if x==y, -1 if x < y, and +1 if x > y. An error is returned, if version string can't be parsed.

func MustCompare added in v0.1.1

func MustCompare(x, y string) int

MustCompare returns an integer comparing two version strings. The result will be 0 if x==y, -1 if x < y, and +1 if x > y.

Types

type InvalidVersion

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

func (InvalidVersion) Error

func (e InvalidVersion) Error() string

type Version

type Version struct {
	X int
	Y string
	Z int
}

func NewVersion

func NewVersion(s string) (*Version, error)

func (Version) Compare

func (v Version) Compare(other Version) int

Compare returns an integer comparing two version strings. The result will be 0 if v==other, -1 if v < other, and +1 if v > other.

Jump to

Keyboard shortcuts

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