Masterminds / semver

Work with Semantic Versions in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fault tolerant constraints

ajkachnic opened this issue · comments

Hello! I've been using this module to parse the versions of NPM packages. It works 95% percent of the time, but occasionally it errors from a constraint like 2 >=2.7.0.

I'm not too sure why this is considered invalid, but it somewhat makes sense. I don't know if it's actually compliant by spec or not.

Regardless, what do you think is the best way to resolve this? This is by far the best Go semver library I've seen, so I'd prefer not to abandon it. If that kind of constraint isn't compliant, is it possible to have a new method to parse more loosely?

I think think this is a bug in the package.

First, there is no spec for version ranges. Some libraries use a different syntax for ranges or the same syntax but it means something different. I wish there was a spec.

I think this is a bug in this package and I'll take a look to confirm.

I took the bug label off because I wasn't able to reproduce the issue in the latest release.

I created an example at https://play.golang.org/p/y3qJTBnZ3Ac

Looking at https://semver.npmjs.com/ and trying some examples... it seems the semver ranges used in npm would produce the same interpretation as this package for this situation.

Where are we not connecting? Can you provide more detail?