Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency with partial versions #146

Open
alecthomas opened this issue Jan 30, 2020 · 2 comments
Open

Inconsistency with partial versions #146

alecthomas opened this issue Jan 30, 2020 · 2 comments
Labels

Comments

@alecthomas
Copy link

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.

@mattfarina
Copy link
Member

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

@mattfarina mattfarina added question and removed bug labels Feb 13, 2020
@mattfarina
Copy link
Member

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-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants