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

Comparison against dirty versions fails #141

Closed
ghost opened this issue Dec 9, 2019 · 1 comment · Fixed by #142
Closed

Comparison against dirty versions fails #141

ghost opened this issue Dec 9, 2019 · 1 comment · Fixed by #142
Labels

Comments

@ghost
Copy link

ghost commented Dec 9, 2019

I notice that with v3.0.1 and v.3.0.2 the comparison fails when the constraint is build with a dirty version (eg. 4.5).

  func main() {
	versionConstraint, err := semver.NewConstraint("1.5.0 - 4.5")
	if err != nil {
		return
	}

	currVersion, err := semver.NewVersion("3.7.0")
	if err != nil {
		return
	}

	fmt.Println(versionConstraint.Check(currVersion))
}

In The Go Playground, where v.1.5.0 is used, there is no such a bug.
From debugging I see that the problem is in constraints.go, line 404 (v3.0.1)

@mattfarina
Copy link
Member

In the playground... https://play.golang.org/p/loDoXzw7Aki

@mattfarina mattfarina added the bug label Dec 12, 2019
mattfarina added a commit to mattfarina/semver that referenced this issue Dec 13, 2019
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.

1 participant