Masterminds / semver

Work with Semantic Versions in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

^0.0 constraint matches major versions that is shouldn't (e.g. 1.0.0)

krmichelos opened this issue · comments

It appears that if the minor and patch versions match the ^0.0 constraint then Check returns true regardless of what the major version is.

package main

import "github.com/Masterminds/semver"

func main() {
	c, _ := semver.NewConstraint( "^0.0")
	v, _ := semver.NewVersion("1.0.0")
	println(c.Check(v))
}

prints true but I would expect based on the readme (^0.0 is equivalent to >=0.0.0 <0.1.0) that it should print false

@mattfarina, since this is the only new code any chance we could get it released as 3.0.2?