To install the package, run:
go get github.com/go-zoox/semver
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")
}
GoZoox is released under the MIT License.