go: pull things out of main.go