diff options
| author | 2026-02-21 13:38:02 +0800 | |
|---|---|---|
| committer | 2026-02-21 14:28:15 +0800 | |
| commit | 94482cb2c97aa215f83940643c5d4c0933727dcb (patch) | |
| tree | bee22fa113542abd1b863ee251fdcf0f9bd409b5 /internal/cache/lru/lru.go | |
| parent | diff: Add package-level doc comment (diff) | |
| signature | No signature | |
*: Modernize and lint; add CI v0.1.17
Diffstat (limited to 'internal/cache/lru/lru.go')
| -rw-r--r-- | internal/cache/lru/lru.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/cache/lru/lru.go b/internal/cache/lru/lru.go index fd080bbd..585aaa3f 100644 --- a/internal/cache/lru/lru.go +++ b/internal/cache/lru/lru.go @@ -90,6 +90,7 @@ func (cache *Cache[K, V]) Get(key K) (V, bool) { return zero, false } cache.lru.MoveToBack(elem) + //nolint:forcetypeassert return elem.Value.(*entry[K, V]).value, true } @@ -100,6 +101,7 @@ func (cache *Cache[K, V]) Peek(key K) (V, bool) { var zero V return zero, false } + //nolint:forcetypeassert return elem.Value.(*entry[K, V]).value, true } @@ -161,6 +163,7 @@ func (cache *Cache[K, V]) evictOverBudget() { } func (cache *Cache[K, V]) removeElem(elem *list.Element) *entry[K, V] { + //nolint:forcetypeassert ent := elem.Value.(*entry[K, V]) cache.lru.Remove(elem) delete(cache.items, ent.key) |
