dashboard: require at least Go 1.12 for aix builder

Fixes golang/go#30799

Change-Id: I0b3b53b715e2dc00f10548f74443224190003818
Reviewed-on: https://go-review.googlesource.com/c/build/+/167357
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 49540f3..b3b8731 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -965,11 +965,16 @@
 	}
 	// Don't build old branches.
 	const minGo1x = 11
-	if strings.HasPrefix(goBranch, "release-branch.go1") && !atLeastGo1(goBranch, minGo1x) {
-		return false
-	}
-	if strings.HasPrefix(branch, "release-branch.go1") && !atLeastGo1(branch, minGo1x) {
-		return false
+	for _, b := range []string{branch, goBranch} {
+		if bmaj, bmin, ok := version.ParseReleaseBranch(b); ok {
+			if bmaj != 1 || bmin < minGo1x {
+				return false
+			}
+			bmm := types.MajorMinor{bmaj, bmin}
+			if bmm.Less(c.MinimumGoVersion) {
+				return false
+			}
+		}
 	}
 
 	// Build dev.boringcrypto branches only on linux/amd64 and windows/386 (see golang.org/issue/26791).
@@ -2053,8 +2058,9 @@
 		SkipSnapshot: true,
 	})
 	addBuilder(BuildConfig{
-		Name:     "aix-ppc64",
-		HostType: "host-aix-ppc64-osuosl",
+		Name:             "aix-ppc64",
+		HostType:         "host-aix-ppc64-osuosl",
+		MinimumGoVersion: types.MajorMinor{1, 12},
 		env: []string{
 			"PATH=/opt/freeware/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin",
 		},
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index 19f8c5b..130e4dd 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -320,6 +320,14 @@
 		{b("freebsd-386-12_0", "go"), onlyPost},
 		{b("freebsd-386-12_0", "net"), onlyPost},
 
+		// AIX starts at Go 1.12
+		{b("aix-ppc64", "go"), onlyPost},
+		{b("aix-ppc64", "net"), onlyPost},
+		{b("aix-ppc64@go1.12", "go"), onlyPost},
+		{b("aix-ppc64@go1.12", "net"), onlyPost},
+		{b("aix-ppc64@go1.11", "go"), none},
+		{b("aix-ppc64@go1.11", "net"), none},
+
 		{b("linux-amd64-nocgo", "mobile"), none},
 
 		// The physical ARM Androids only runs "go":