(k string)
| 184 | } |
| 185 | |
| 186 | func (c *cache) get(k string) (interface{}, bool) { |
| 187 | item, found := c.items[k] |
| 188 | if !found { |
| 189 | return nil, false |
| 190 | } |
| 191 | // "Inlining" of Expired |
| 192 | if item.Expiration > 0 { |
| 193 | if time.Now().UnixNano() > item.Expiration { |
| 194 | return nil, false |
| 195 | } |
| 196 | } |
| 197 | return item.Object, true |
| 198 | } |
| 199 | |
| 200 | // Increment an item of type int, int8, int16, int32, int64, uintptr, uint, |
| 201 | // uint8, uint32, or uint64, float32 or float64 by n. Returns an error if the |
no outgoing calls