(k string)
| 912 | } |
| 913 | |
| 914 | func (c *cache) delete(k string) (interface{}, bool) { |
| 915 | if c.onEvicted != nil { |
| 916 | if v, found := c.items[k]; found { |
| 917 | delete(c.items, k) |
| 918 | return v.Object, true |
| 919 | } |
| 920 | } |
| 921 | delete(c.items, k) |
| 922 | return nil, false |
| 923 | } |
| 924 | |
| 925 | type keyAndValue struct { |
| 926 | key string |
no outgoing calls