libgo: change gotest to run examples with output

Change the gotest script to act like "go test" and run examples that
have "output" comments.  This is not done with full generality, but
just enough to run the libgo tests.  Other packages should be tested
with "go test" as usual.

While we're here clean up some old bits of gotest, and only run
TestXXX functions that are actually in *_test.go files.  The latter
change should fix https://gcc.gnu.org/PR89168.

Change-Id: I81d3ef491bb5f6d7aafb0b466671d4b442f8976e
Reviewed-on: https://go-review.googlesource.com/c/162139
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2 files changed