Skip to content

Commit 43fd47e

Browse files
authored
docs: fixed signature of function argument
1 parent 458637f commit 43fd47e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TTLCache - an in-memory cache with item expiration
1+
[#](#) TTLCache - an in-memory cache with item expiration
22

33
[![Go Reference](https://pkg.go.dev/badge/github.com/jellydator/ttlcache/v3.svg)](https://pkg.go.dev/github.com/jellydator/ttlcache/v3)
44
[![Build Status](https://github.com/jellydator/ttlcache/actions/workflows/go.yml/badge.svg)](https://github.com/jellydator/ttlcache/actions/workflows/go.yml)
@@ -100,10 +100,10 @@ func main() {
100100
ttlcache.WithCapacity[string, string](300),
101101
)
102102

103-
cache.OnInsertion(func(item *ttlcache.Item[string, string]) {
103+
cache.OnInsertion(func(ctx context.Context, item *ttlcache.Item[string, string]) {
104104
fmt.Println(item.Value(), item.ExpiresAt())
105105
})
106-
cache.OnEviction(func(reason ttlcache.EvictionReason, item *ttlcache.Item[string, string]) {
106+
cache.OnEviction(func(ctx context.Context, reason ttlcache.EvictionReason, item *ttlcache.Item[string, string]) {
107107
if reason == ttlcache.EvictionReasonCapacityReached {
108108
fmt.Println(item.Key(), item.Value())
109109
}

0 commit comments

Comments
 (0)