From ac0fcef49b2720e0bdbbf39c0c923c1299479247 Mon Sep 17 00:00:00 2001 From: Patrick Mylund Nielsen Date: Sat, 28 Nov 2015 12:27:08 -0500 Subject: [PATCH] Clarify that the OnEvicted function isn't called when an item is overwritten --- cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cache.go b/cache.go index 7fec2b6..bbc936a 100644 --- a/cache.go +++ b/cache.go @@ -853,8 +853,8 @@ func (c *cache) DeleteExpired() { } // Sets an (optional) function that is called with the key and value when an -// item is evicted from the cache. (Including when it is deleted manually.) -// Set to nil to disable. +// item is evicted from the cache. (Including when it is deleted manually, but +// not when it is overwritten.) Set to nil to disable. func (c *cache) OnEvicted(f func(string, interface{})) { c.mu.Lock() defer c.mu.Unlock()