Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment overstates the behavior + naming inconsistent with sibling comparators.
The comment says this "prefer[s] released versions over libpng's non-semver beta tags," but the body just delegates to
semver.Compare(a.Version, b.Version)— there is no beta-handling logic here. The "preference" is an incidental side effect ofgolang.org/x/mod/semver: an invalid semver string canonicalizes to""and sorts below any valid version. Notev1.7.0beta89is invalid semver (a prerelease needs a hyphen,v1.7.0-beta89), so all such non-canonical tags collapse to a single "equal, lowest" bucket — they can't be ordered relative to each other, and a newerv1.7.0beta89sorts below an older releasedv1.6.58. Consider rewording to describe the actual mechanism (delegates tosemver.Compare; non-canonical tags are treated as invalid and sort lowest) rather than implying deliberate release-preference logic.semver.compare(lowercase) is functionally valid — XGo resolves it to the exportedsemver.Compare— but both sibling comparator files use the canonicalsemver.Compare(internal/build/testdata/pnggroup/libpng/libpng_cmp.gox:2,internal/modules/testdata/DaveGamble/cJSON/CJSON_cmp.gox:2). Prefersemver.Comparefor consistency. Those files also use 4-space indentation while this one uses tabs.