golang channel这种方式的优点是通过提供原子的通信原语,避免了竞态情形(race condition)下复杂的锁机制。
channel
channel 是可以让一个 goroutine 发送特定值到另一个 gouroutine 的通信机制。 (