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

master
Patrick Mylund Nielsen 9 years ago
parent e9441b12e0
commit ac0fcef49b

@ -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()

Loading…
Cancel
Save