1
0

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

View File

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