Copy pasta from playground http://play.golang.org/p/NqcFjh_Zan