From ac1a1aeef96f0837072c40e547605c4c7abb900f Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Wed, 4 Jan 2012 11:37:02 +0100 Subject: [PATCH] Increment should return an error if the targeted item has expired --- cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.go b/cache.go index 8470070..a9757c2 100644 --- a/cache.go +++ b/cache.go @@ -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") }