go: optimize tests

These are some general test optimizations.

This PR should include #324 and #327. Please wait until they are in master and I rebased this PR before merging.
For now this PR is just here for discussion and to avoid overlapping PRs.