Besides what others already suggested, you'll find the reason in the
Go memory model specification:
https://golang.org/ref/mem
This part is relevant here:
"If the effects of a goroutine must be observed by another goroutine,
use a synchronization mechanism such as a lock or channel
communication to establish a relative ordering."
+1:
Instead of html in email, please use only text. Although in this
particular case the playground links would have been just enough.
(If you are curious, my email reader renders the code text with light
yellow on white background. )
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/golang-nuts/9c57fc61-141b-40b5-947a-5d7a3ad3547e%40googlegroups.com.