semver

package
v0.0.0-...-c45fd6a Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCompatible

func CheckCompatible(v1, v2 Version) bool

CheckCompatible returns a boolean value indicating if v2 is compatible again v1. The v2 will be compatible if accoplish this constraints: - Has same major version - If major version is 0 the version should be equals - If major version is not 0 the version v1 minor should be equals or lower than v2 minor

func Compare

func Compare(v1, v2 Version) int

Compare returns an integer comparing two versions according to semantic version precedence. The result will be 0 if v1 == v2, -1 if v1 < v2, or +1 if v1 > v2.

Types

type Version

type Version interface {
	// Major major version
	Major() int
	// Minor minor version
	Minor() int
	// Patch patch version
	Patch() int
}

Version represents semver version

For more info see https://semver.org/

Jump to

Keyboard shortcuts

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