The std lib log
package handles a lot of this for you. You can either log to STDOUT/STDERR or set the output of the log package itself by doing as follows:
log.SetOutput(<something that implements io.Writer>)
log.Println("some message")
And depending on what that io.Writer is (i.e. an os.File, net.TCPConn, net.UDPConn, etc) it will log "some message" to it.
This can also be done on a per logger basis like so
logger := log.New(<something that implements io.Writer>, <log prefix string>, <log flags https://golang.org/pkg/log/#pkg-constants>)
logger.Println("Some message")
This example will accomplish the same thing and add a prefix to each log. The second example is a struct instead of functions from the package, so that will have to be shared across Goroutines correrctly. This example can implement log levels by having each level be its own logger instance.
It's also worth taking a look at logrus https://github.com/Sirupsen/logrus it handles a lot of the boilerplate for you.