Don’t communicate by sharing memory; share memory by communicating. (R. Pike)
在The Go Memory Model我可以读到这个：
A send on a channel happens before the corresponding receive from that channel completes. (Golang Spec)
After a goroutine1 sends (anything) to a goroutine2 via a channel, then all changes (anywhere in the memory) done by goroutine1 must be visible to goroutine2 after it received via same channel. (Golang Lemma by Me:)
To synchronize memory access between two goroutines, you don’t need to send that memory via channel. Good enough is to receive from the channel (even nothing). You will see any changes that were written (anywhere) by the goroutine sending (to the channel) at the time of it’s send. (Of course, assuming no other goroutines are writing to the same memory.) Update (2) 8-26-2017
请注意,我们还要关注两个goroutine的简单用法,这两个goroutines通过单个通道和相关的记忆效应进行通信而不是最佳实践 – 这超出了本问题的范围.
为了更好地理解我的问题的范围,假设goroutine可以访问任何类型的内存结构 – 不仅是原始的 – 并且它可以是一个大的,它可以是字符串,映射,数组,等等.