You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// memoryStore holds the registered services only into memorytypememoryStorestruct {
mu sync.RWMutexservicesMapmap[string][]string
}
// Get returns all the registered service informationfunc (l*memoryStore) GetAll() map[string][]string {
l.mu.RLock()
deferl.mu.RUnlock()
returnl.servicesMap
}
Proposal:
Clone a map and return
Support access the map under protection
The text was updated successfully, but these errors were encountered:
To preserve the meaning of GetAll, I prefer to clone a map and return it, potentially leave the overhead to the caller (caller should know this function call will be expensive)
Proposal:
The text was updated successfully, but these errors were encountered: