File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ func Zero() SemVer {
5353// versions are also automatically corrected from e.g. "go1.20rc1" to "v1.20-rc1". If given
5454// the empty string, this function return `nil`. Otherwise, for invalid version strings, the function
5555// 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.
5662func NewSemVer (version string ) SemVer {
5763 // If the input is the empty string, return `nil` since we use `nil` to represent "no version".
5864 if version == "" {
You can’t perform that action at this time.
0 commit comments