Changes build to test go 1.21rc2 (#1571)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-07-10 13:39:37 +08:00
committed by GitHub
parent 86cf46d021
commit 15fa5c4de5
13 changed files with 57 additions and 39 deletions

View File

@@ -5,12 +5,17 @@
package platform
import (
"regexp"
"runtime"
"strings"
)
// TODO: IsAtLeastGo120
var IsGo120 = strings.Contains(runtime.Version(), "go1.20")
// IsAtLeastGo120 checks features added in 1.20. We can remove this when Go
// 1.22 is out.
var IsAtLeastGo120 = isAtLeastGo120(runtime.Version())
func isAtLeastGo120(version string) bool {
return regexp.MustCompile("go1.[2-9][0-9][^0-9]").MatchString(version)
}
// archRequirementsVerified is set by platform-specific init to true if the platform is supported
var archRequirementsVerified bool