Clarify that the OnEvicted function isn't called when an item is overwritten

This commit is contained in:
Patrick Mylund Nielsen 2015-11-28 12:27:08 -05:00
parent e9441b12e0
commit ac0fcef49b
1 changed files with 2 additions and 2 deletions

View File

@ -853,8 +853,8 @@ func (c *cache) DeleteExpired() {
} }
// Sets an (optional) function that is called with the key and value when an // 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.) // item is evicted from the cache. (Including when it is deleted manually, but
// Set to nil to disable. // not when it is overwritten.) Set to nil to disable.
func (c *cache) OnEvicted(f func(string, interface{})) { func (c *cache) OnEvicted(f func(string, interface{})) {
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()