libgo: handle go1.10+ correctly in match.sh

match.sh was not correctly handling build constraints for Go versions
that have a two-digit suffix, like "go1.10".

The same issue will arise with Go 1.100, but that is a long ways off.

Change-Id: I0d41d60aad800d681a12ede68fbe0763289ec268
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/260077
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
diff --git a/libgo/match.sh b/libgo/match.sh
index 6f7b368..04db8d2 100755
--- a/libgo/match.sh
+++ b/libgo/match.sh
@@ -151,18 +151,18 @@
 		    fi
 		    match=false
 		    ;;
-		$goos | $goarch | $cgotag | $cmdlinetag | "gccgo" | go1.[0-9])
+		$goos | $goarch | $cgotag | $cmdlinetag | "gccgo" | go1.[0-9] | go1.[0-9][0-9])
 		    match=true
 		    ;;
-		"!"$goos | "!"$goarch | "!"$cgotag | "!"$cmdlinetag | "!gccgo" | "!"go1.[0-9])
+		"!"$goos | "!"$goarch | "!"$cgotag | "!"$cmdlinetag | "!gccgo" | "!"go1.[0-9] | "!"go1.[0-9][0-9])
 		    ;;
 		*,*)
 		    cmatch=true
 		    for ctag in `echo $tag | sed -e 's/,/ /g'`; do
 			case $ctag in
-			    $goos | $goarch | $cgotag | $cmdlinetag | "gccgo" | go1.[0-9])
+			    $goos | $goarch | $cgotag | $cmdlinetag | "gccgo" | go1.[0-9] | go1.[0-9][0-9])
 				;;
-			    "!"$goos | "!"$goarch | "!"$cgotag | "!"$cmdlinetag | "!gccgo" | "!"go1.[0-9])
+			    "!"$goos | "!"$goarch | "!"$cgotag | "!"$cmdlinetag | "!gccgo" | "!"go1.[0-9] | "!"go1.[0-9][0-9])
 				cmatch=false
 				;;
 			    "!"*)
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 5bb27ec..0fd6419 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -342,18 +342,18 @@
 			fi
 			match=false
 			;;
-		    $goos | $goarch | cgo | gccgo | go1.[0-9])
+		    $goos | $goarch | cgo | gccgo | go1.[0-9] | go1.[0-9][0-9])
 			match=true
 			;;
-		    "!"$goos | "!"$goarch | "!cgo" | "!gccgo" | "!"go1.[0-9])
+		    "!"$goos | "!"$goarch | "!cgo" | "!gccgo" | "!"go1.[0-9] | "!"go1.[0-9][0-9])
 			;;
 		    *,*)
 			cmatch=true
 			for ctag in `echo $tag | sed -e 's/,/ /g'`; do
 			    case $ctag in
-			    $goos | $goarch | cgo | gccgo | go1.[0-9])
+			    $goos | $goarch | cgo | gccgo | go1.[0-9] | go1.[0-9][0-9])
 				;;
-			    "!"$goos | "!"$goarch | "!cgo" | "!gccgo" | "!"go1.[0-9])
+			    "!"$goos | "!"$goarch | "!cgo" | "!gccgo" | "!"go1.[0-9] | "!"go1.[0-9][0-9])
 				cmatch=false
 				;;
 			    "!"*)