summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cache/cache.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/cache/cache.go b/cache/cache.go
index 905aebe..8f29ee4 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -39,15 +39,13 @@ func (c *Cache) Set(key string, value []byte, expires time.Time) {
// Get an (key,value) item from the cache store by key.
//
// An empty []byte will be returned when if the key does not exist or
-// if the item corresponding to the key has expired. An expired
-// (key,value) item will be removed from the cache store.
+// if the item corresponding to the key has expired.
func (c *Cache) Get(key string) []byte {
if _, ok := c.store[key]; !ok {
return []byte{}
}
// Check if the item expired.
if time.Until(c.store[key].expires).Seconds() < 0 {
- delete(c.store, key)
return []byte{}
}
return c.store[key].value