1
0

Increment should return an error if the targeted item has expired

This commit is contained in:
Patrick Mylund Nielsen 2012-01-04 11:37:02 +01:00
parent e5b84e20fc
commit ac1a1aeef9

View File

@ -191,7 +191,7 @@ func (c *cache) IncrementFloat(k string, n float64) error {
defer c.mu.Unlock()
v, found := c.Items[k]
if !found {
if !found || v.Expired() {
return fmt.Errorf("Item not found")
}