Inspired by: https://groups.google.com/forum/#!topic/golang-nuts/BFrI6KeITVc