diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-01 19:33:03 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-01 22:42:08 -0700 |
commit | a06a7fb2d5bbf1ca5659de06fc9e975666bdcf9f (patch) | |
tree | 268aaa2725e4ad336412118779377177601c662b /lib/containers/lru.go | |
parent | c307e7048da3c02e1e540eab227def7fec7340cc (diff) |
lint: Turn on gofumpt
All edits to .go files are made by
`tools/bin/golangci-lint run --fix ./...`, not by me as a human.
Diffstat (limited to 'lib/containers/lru.go')
-rw-r--r-- | lib/containers/lru.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/containers/lru.go b/lib/containers/lru.go index 12446b0..bfda361 100644 --- a/lib/containers/lru.go +++ b/lib/containers/lru.go @@ -36,10 +36,12 @@ func (c *LRUCache[K, V]) Add(key K, value V) { c.init() c.inner.Add(key, value) } + func (c *LRUCache[K, V]) Contains(key K) bool { c.init() return c.inner.Contains(key) } + func (c *LRUCache[K, V]) Get(key K) (value V, ok bool) { c.init() _value, ok := c.inner.Get(key) @@ -49,6 +51,7 @@ func (c *LRUCache[K, V]) Get(key K) (value V, ok bool) { } return value, ok } + func (c *LRUCache[K, V]) Keys() []K { c.init() untyped := c.inner.Keys() @@ -59,10 +62,12 @@ func (c *LRUCache[K, V]) Keys() []K { } return typed } + func (c *LRUCache[K, V]) Len() int { c.init() return c.inner.Len() } + func (c *LRUCache[K, V]) Peek(key K) (value V, ok bool) { c.init() _value, ok := c.inner.Peek(key) @@ -72,10 +77,12 @@ func (c *LRUCache[K, V]) Peek(key K) (value V, ok bool) { } return value, ok } + func (c *LRUCache[K, V]) Purge() { c.init() c.inner.Purge() } + func (c *LRUCache[K, V]) Remove(key K) { c.init() c.inner.Remove(key) |