Open radeksimko opened 1 year ago
I recently compared the regular expression used by go-version with the one proposed on semver.org
And I confirm there are many false positive: go-version: https://regex101.com/r/KP9LZN/1 semver.org: https://regex101.com/r/Ly7O1x/3/
As discovered by @rclark
The semver spec is clear that build or prerelease identifiers MUST come after a
-
.Versions, such as the following
are treated as "valid". I intentionally put valid in quotes because it's clear that the internal representation of such a version is wrong anyway. All the consumer can reliably do with that parsed version is to call
String()
on it to reconstruct the same (invalid) version. https://go.dev/play/p/hyp8ZZJQO8-The Readme of
go-version
explicitly saysTherefore I would treat this as a bug.