which is getting accessed from one goroutine only and acts as a cache
global variables are pretty bad, right?
Is this situation with global map ok? or I should I use some other pattern?
Avoid using shared memory if you can. If you have to use it for the sake of efficiency or use case, you may encounter a race condition. To solve races you can use sync.Mutex or sync.RWMutex .
Обсуждают сегодня