type gover … // compare returns -1, 0, or +1 depending on whether // x < y, x == y, or x > y, interpreted as toolchain versions. // The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". // Malformed versions compare less than well-formed versions and equal to each other. // The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". func compare(x, y string) int { … } // lang returns the Go language version. For example, lang("1.2.3") == "1.2". func lang(x string) string { … } // isValid reports whether the version x is valid. func isValid(x string) bool { … } // parse parses the Go version string x into a version. // It returns the zero version if x is malformed. func parse(x string) gover { … } // cutInt scans the leading decimal number at the start of x to an integer // and returns that value and the rest of the string. func cutInt(x string) (n, rest string, ok bool) { … } // cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. // (Copied from golang.org/x/mod/semver's compareInt.) func cmpInt(x, y string) int { … }