Skip to content

Commit ac0fcef

Browse files
committed
Clarify that the OnEvicted function isn't called when an item is overwritten
1 parent e9441b1 commit ac0fcef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,8 @@ func (c *cache) DeleteExpired() {
853853
}
854854

855855
// Sets an (optional) function that is called with the key and value when an
856-
// item is evicted from the cache. (Including when it is deleted manually.)
857-
// Set to nil to disable.
856+
// item is evicted from the cache. (Including when it is deleted manually, but
857+
// not when it is overwritten.) Set to nil to disable.
858858
func (c *cache) OnEvicted(f func(string, interface{})) {
859859
c.mu.Lock()
860860
defer c.mu.Unlock()

0 commit comments

Comments
 (0)