File tree 1 file changed +6
-0
lines changed 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ func Zero() SemVer {
53
53
// versions are also automatically corrected from e.g. "go1.20rc1" to "v1.20-rc1". If given
54
54
// the empty string, this function return `nil`. Otherwise, for invalid version strings, the function
55
55
// prints a message to the log and exits the process.
56
+ //
57
+ // Note that we deliberately do not format the resulting [SemVer] to be in a `Canonical` representation.
58
+ // This is because we want to maintain the input version specificity for as long as possible. This is useful
59
+ // for e.g. `IdentifyEnvironment` where we want to output "1.22" if the project specifies "1.22" as the
60
+ // required Go version, rather than outputting "1.22.0", which implies a specific patch-level version
61
+ // when the intention is that any patch-level version of "1.22" is acceptable.
56
62
func NewSemVer (version string ) SemVer {
57
63
// If the input is the empty string, return `nil` since we use `nil` to represent "no version".
58
64
if version == "" {
You can’t perform that action at this time.
0 commit comments