Skip to content

Commit 8ff7701

Browse files
committed
added comment for Reference method
1 parent 82f85aa commit 8ff7701

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cache.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type Item[K comparable, V any] struct {
2424
ReferencedAt time.Time
2525
}
2626

27+
// Referenced increments a reference counter and updates `ReferencedAt`
28+
// to current time.
2729
func (i *Item[K, V]) Referenced() {
2830
i.ReferenceCount++
2931
i.ReferencedAt = nowFunc()

0 commit comments

Comments
 (0)