Get fetches the value with the given key. If the key is not present in the cache Get returns (nil, false).
(key string)
| 77 | // Get fetches the value with the given key. If the key is not present |
| 78 | // in the cache Get returns (nil, false). |
| 79 | func (c *Cache) Get(key string) (val interface{}, ok bool) { |
| 80 | if *c == nil { |
| 81 | return nil, false |
| 82 | } |
| 83 | |
| 84 | val, ok = (*c)[key] |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | // Set assigns the given value to a specific key. |
| 89 | func (c *Cache) Set(key string, val interface{}) { |
nothing calls this directly
no outgoing calls
no test coverage detected