Skip to content

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

@nguyen-phillip

Description

@nguyen-phillip

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions