Fix tests for Go 1.21.1

Fixes #11450
This commit is contained in:
Bjørn Erik Pedersen 2023-09-14 12:12:19 +02:00
parent 75c0f88289
commit 79a17d9e55

View file

@ -398,7 +398,7 @@ func testSetupFunc() func(env *testscript.Env) error {
goVersion := runtime.Version()
goVersion = strings.TrimPrefix(goVersion, "go")
if !strings.HasSuffix(goVersion, ".0") {
if strings.HasPrefix(goVersion, "1.20") {
// Strip patch version.
goVersion = goVersion[:strings.LastIndex(goVersion, ".")]
}