The following code demonstrates an issue I ran into recently:
The first line in the main function is creating a new variable in that
scope which shadows the global variable. This means that any changes I make
are not reflected in the other go routine since it points at the global
This was very confusing and took me a long time to track down. The reason I
have the := and not = on that line is because I AM creating a new error
variable.. I assumed the error variable would be created and the struct
variable would just be updated.
Just thought I would point it out and it's the first time go has done
something unexpected for me.