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

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

Closed
krmichelos opened this issue Nov 3, 2019 · 1 comment · Fixed by #134
Closed

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

krmichelos opened this issue Nov 3, 2019 · 1 comment · Fixed by #134
Labels

Comments

@krmichelos
Copy link
Contributor

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

@krmichelos
Copy link
Contributor Author

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

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

Successfully merging a pull request may close this issue.

2 participants