Here's a short snippet of code that demonstrates a surprising effect of golang's variable scoping rules. (This is maybe only surprising for me, with Python's scoping rules deeply ingrained in my brain.)
In the real world, this came up in the context of an HTTP middleware function, where state accumulated in surprising ways across multiple requests to the handler wrapped by the middleware.
Try it out on the Go Playground: https://play.golang.org/p/s2KHE-8Kbyd