goenv: parse patch version, add func Compare to compare two Go version strings (#4536)

goenv: parse patch version, add func Compare to compare two Go version strings
* Parse tests
* add Compare function to compare two Go version strings
* goenv, builder: parse patch version in Go version string
This commit is contained in:
Randy Reddig
2024-10-21 16:01:59 +02:00
committed by GitHub
parent 23d3a31107
commit a191326ea8
3 changed files with 113 additions and 11 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
// compiled with the latest Go version.
// This may be a bit too aggressive: if the newer version doesn't change the
// Go language we will most likely be able to compile it.
buildMajor, buildMinor, err := goenv.Parse(runtime.Version())
buildMajor, buildMinor, _, err := goenv.Parse(runtime.Version())
if err != nil {
return nil, err
}