[Golang (Go)] Use sync.Mutex, sync.RWMutex to lock share data for race condition
sync.Mutex & sync.RWMutex
Mutex and RWMutex are not associated with goroutines, but RWMutex is obviously more suitable for scenarios with more reads and less writes. For read performance only, RWMutex is higher than Mutex, because multiple reads of rwmutex can coexist.