What language is that code written in? It looks more like Javascript than Go to me.
If you have a problem with some Go code, please can you show the Go code - ideally as a self-contained runnable example at play.golang.org -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6af11a19-70d9-47ec-af9e-74ac1c1f710ao%40googlegroups.com.