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
gup's version comparison is using a simple lexicographic string comparison. This does not work properly e.g. when the number of digits in a version changes.
Steps to reproduce
Example case added in #159 -- 1.2.0 is treated as newer than 1.11.5.
Expected behavior
1.2.0 is older than 1.11.5.
Additional details**
I don't know if the version comparison implementation used by go mod is exposed somewhere. But that would be a good one to use for this.
The text was updated successfully, but these errors were encountered:
I can create a new PR and fix it myself.
However, I think it would be better for you to update PR #159 so that your contribution record remains. What do you think?
Thanks for addressing this! And no problem at all with not taking #159.
I had a look at that go-version lib myself, but seeing that it is documented to take semver and for example go module snapshot version numbers not following semver, I wasn't quite sure if it's the best choice. But I'm sure it will work fine for the majority of cases.
I would however suggest adding some snapshot versions to the test suite (e.g. grabbed with gup update -m something) to verify that it indeed works as intended for those versions as well.
gup version**
v0.27.1
Description (About the problem)
gup's version comparison is using a simple lexicographic string comparison. This does not work properly e.g. when the number of digits in a version changes.
Steps to reproduce
Example case added in #159 -- 1.2.0 is treated as newer than 1.11.5.
Expected behavior
1.2.0 is older than 1.11.5.
Additional details**
I don't know if the version comparison implementation used by go mod is exposed somewhere. But that would be a good one to use for this.
The text was updated successfully, but these errors were encountered: