Inconsistency with partial versions
alecthomas opened this issue · comments
Alec Thomas commented
This prints true:
c, _ := semver.NewConstraint("2")
v, _ := semver.NewVersion("2.2.3")
fmt.Println(c.Check(v))
While this prints false:
c, _ := semver.NewConstraint("2.2")
v, _ := semver.NewVersion("2.2.3")
fmt.Println(c.Check(v))
Is that intentional? If not I can fire off a PR.
Matt Farina commented
@alecthomas Thanks for catching this. You did find a bug.
Matt Farina commented
Actually, what version of sermver are you using? In semver v3 I do not get the same result as you. See https://play.golang.org/p/DhG4bHORwf-