sync.Mutex protects a critical section with Lock() and Unlock(). Always pair them, usually with defer. sync.RWMutex allows many concurrent readers or a single writer. Forgetting the lock leads to a race condition.
mu.Lock()
defer mu.Unlock()
count++