go: fix golint errors and some general cleanup/consolidation.