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

Googet should interpret the version string "1" as "1.0.0" instead of "0.0.1" #127

Open
nguyen-phillip opened this issue Nov 21, 2024 · 0 comments

Comments

@nguyen-phillip
Copy link
Collaborator

ParseVersion and fixVer in goospec.go have the unexpected behavior of taking version strings with less than 3 components and converting them into 3-component versions by prepending leading 0s rather than appending 0s. This means that "1" becomes "0.0.1" and "1.2" becomes "0.1.2" which results in comparisons like

  • "1" < "1.0" < "1.0.0"
  • "2" < "1.1"
  • "3" < "1.0.0"
  • "1.5" < "1.2.0"

This is contrary to the behavior of semver.ParseTolerant and common interpretations of version string comparisons.

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

1 participant