libgo: don't use wc in gotest

The wc command is not in the GNU approved list of Makefile utilities
(https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html#Utilities-in-Makefiles).

Change-Id: I5491352662e6218a165b91c9b723720d1aa46b02
Reviewed-on: https://go-review.googlesource.com/c/144897
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index f1309ab..0b2e572 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -518,10 +518,9 @@
   local ndots=""
   for tp in $*
   do
-    s=$(echo $tp | sed -e 's/\.\.z2f/%/g' | sed -e 's/.*%//')
+    s=$(echo "$tp" | sed -e 's/\.\.z2f/%/g' | sed -e 's/.*%//')
     # screen out methods (X.Y.Z)
-    ndots=$(echo $s | sed -e 's/\./ /g' | wc -w)
-    if [ $ndots -ne 2 ]; then
+    if ! expr "$s" : '^[^.]*\.[^.]*$' >/dev/null 2>&1; then
       continue
     fi
     if [ -z "${result}" ]; then