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
This call version.NewSemver("1.010.2") should return an error due to the leading zero on the minor version, but it does not. When you add a leading zero, it is not clear if the number is in octal or base 10.
A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version. Each element MUST increase numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0.
The text was updated successfully, but these errors were encountered:
The possibility of someone using Octal in a version number is laughably low. Leading zeros are commonly used to improving file sorting in file systems.
The possibility of someone using Octal in a version number is laughably low.
I wasn't suggesting that anyone would. The chance that a numeric parser will see the leading zero and parse the number incorrectly as octal is extremely high. There is a reason the standard forbids leading zeros.
This call
version.NewSemver("1.010.2")
should return an error due to the leading zero on the minor version, but it does not. When you add a leading zero, it is not clear if the number is in octal or base 10.The wording of the specification (https://semver.org/) is:
The text was updated successfully, but these errors were encountered: