You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
carolynvs
changed the title
NewConstraintIC interprets a dash in the metadata as a range separator
NewConstraintIC interprets a dash in the prerelease tag as a range separator
Jul 26, 2017
In golang/dep, we are using
semver.NewConstraintIC
to parse raw strings as constraints and some of them aren't being handled as expected:v1.12.0-g2fd980e
properly returns(semver.rangeConstraint) ^1.12.0-g2fd980e
v0.12.0-12-g2fd980e
returns(semver.rangeConstraint) >=0.12.0, <=12.0.0-g2fd980e
, when I expected^1.12.0-g2fd980e
v1.12.0-2-g2fd980e
returns(semver.rangeConstraint) >=1.12.0, <=2.0.0-g2fd980e
, when I expected^v1.12.0-2-g2fd980e
.v1.3.1-1-gf12c623
returns an unexpected(semver.none)
. I expected^1.3.1-1-gf12c623
, or at the very least an error.Essentially the dash in the prerelease tag is causing the function parse the input a range between
v1.3.1 to 1-gf12c623
.I'm going to try having it first check if the input string is a valid version first, and if that pans out, submit a PR.
The text was updated successfully, but these errors were encountered: