Mutex — protects shared memory. Channel — communicates between goroutines.
Mutex:
1var mu sync.Mutex2var counter int34func increment() {5 mu.Lock()6 counter++7 mu.Unlock()8}
Channel:
1ch := make(chan int)23go func() {4 ch <- 425}()67value := <-ch
Go philosophy: