Changes build to test go 1.21rc2 (#1571)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user