/gosemver

Version comparing library in go (using semantic versioning standard http://semver.org)

Primary LanguageGoGNU General Public License v3.0GPL-3.0

gosemver Bitdeli Badge

LICENCE: GNU GPL v3

Version comparing library in go (using semantic versioning standard http://semver.org)

Compare 2 version formats for which is greater.
For valid version examples and more information see http://semver.org
Returns: 0 if equals, 1 if the first version arg is greater, 2 if the second, -1 if problem occured.

Usage

package main

import (
	"fmt"
	"github.com/Jakosa/gosemver"
)

func main() {
	fmt.Println(gosemver.Compare("v0.3.6", "0.4")) // prints 2
}