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

Fault tolerant constraints #162

Open
ajkachnic opened this issue Mar 25, 2021 · 2 comments
Open

Fault tolerant constraints #162

ajkachnic opened this issue Mar 25, 2021 · 2 comments

Comments

@ajkachnic
Copy link

ajkachnic commented Mar 25, 2021

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?

@mattfarina mattfarina added the bug label Mar 26, 2021
@mattfarina
Copy link
Member

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.

@mattfarina mattfarina removed the bug label Mar 26, 2021
@mattfarina
Copy link
Member

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?

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

No branches or pull requests

2 participants