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

doc: hyphen range constraint without whitespace #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnnychen94
Copy link

I was a bit surprised that the following doesn't work as expected at first sight:

package main

import (
	"github.com/Masterminds/semver/v3"
)

func main() {
	c, err := semver.NewConstraint("0.7.2-0.8.0")
	if err != nil {
		panic(err)
	}
	v, err := semver.NewVersion("0.7.25")
	if err != nil {
		panic(err)
	}
	println(c.Check(v))
}

then I realized that we need whitespace between:

-	c, err := semver.NewConstraint("0.7.2-0.8.0")
+ 	c, err := semver.NewConstraint("0.7.2 - 0.8.0")

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

Successfully merging this pull request may close these issues.

None yet

1 participant