There was an error while loading. Please reload this page.
1 parent f3dc311 commit 26a9b08Copy full SHA for 26a9b08
2 files changed
cache.go
@@ -402,7 +402,7 @@ func (cache *Cache[T]) Stats() Stats {
402
403
// Resize the cache to hold at most n entries. If n is smaller than the current
404
// size, entries are evicted to fit the new size. It errors if n <= 0.
405
-func (cache *Cache) Resize(n int) error {
+func (cache *Cache[T]) Resize(n int) error {
406
if n <= 0 {
407
return errors.New("must supply a positive capacity to Resize")
408
}
cache_test.go
@@ -355,7 +355,7 @@ func TestActiveExpiration(t *testing.T) {
355
356
357
func TestResize(t *testing.T) {
358
- cache := New(Config{
+ cache := New(Config[int]{
359
Capacity: 2,
360
})
361
cache.Set("a", 1)
0 commit comments