Yep, should have looked for it earlier: http://golang.org/pkg/os/#Hostname