Masterminds / semver

Work with Semantic Versions in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistency with partial versions

alecthomas opened this issue · comments

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.

@alecthomas Thanks for catching this. You did find a bug.

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-