My suggestion is something like this: https://play.golang.org/p/1NdQbAW65k
There is a discussion very similar to this from a few days ago: https://groups.google.com/forum/#!topic/golang-nuts/AeV0BYaWABw -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.