Get retrieves the value associated with the given key from the SyncMap. It returns the value and a boolean indicating whether the key was found.
(key string)
| 19 | // Get retrieves the value associated with the given key from the SyncMap. |
| 20 | // It returns the value and a boolean indicating whether the key was found. |
| 21 | func (sm *SyncMap) Get(key string) (entry interface{}, ok bool) { |
| 22 | sm.lock.RLock() |
| 23 | defer sm.lock.RUnlock() |
| 24 | entry, ok = (*sm.mapObj)[key] |
| 25 | return |
| 26 | } |
| 27 | |
| 28 | // Set sets a new entry or updates an existing one. |
| 29 | // Set adds or updates an entry in the SyncMap with the specified key. |
no outgoing calls