Skip to content

go-zoox/semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Semver Version Compare

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/semver

Getting Started

func TestIsGreatThan(t *testing.T) {
	res, _ := IsGreatThan("v2.0.0", "v1.0.0")
	testify.Assert(t, res, "v2.0.0 should be greater than v1.0.0")

	res, _ = IsGreatThan("v2.1.0", "v2.0.0")
	testify.Assert(t, res, "v2.1.0 should not be greater than v2.0.0")

	res, _ = IsGreatThan("v2.0.1", "v2.0.0")
	testify.Assert(t, res, "v2.0.1 should not be greater than v2.0.0")

	res, _ = IsGreatThan("v2.0.0", "v2.0.0")
	testify.Assert(t, !res, "v2.0.0 should not be greater than v2.0.0")

	res, _ = IsGreatThan("v1.0.0", "v2.0.0")
	testify.Assert(t, !res, "v1.0.0 should not be greater than v2.0.0")
}

License

GoZoox is released under the MIT License.

About

Semver Version Compare for Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages