Get value from lru if not found, return nil
(key string)
| 39 | // Get value from lru |
| 40 | // if not found, return nil |
| 41 | func (c *LRU) Get(key string) any { |
| 42 | v, ok := c.storage[key] |
| 43 | if ok { |
| 44 | c.dl.MoveToBack(v) |
| 45 | return v.Val.(item).value |
| 46 | } |
| 47 | |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | // Put cache with key and value to lru |
| 52 | func (c *LRU) Put(key string, value any) { |