Fix all Go tests to build with "go build"

Tested against Go 1.6 through Go 1.13beta1, and gccgo.

Fixes #1607
167 files changed