improve go example

and fix some build error
http://play.golang.org/p/D3tFh-wazG