improve go example

and fix some build error
It's not the same as Map in Swift, which is a function.