|
|
@@ -8,6 +8,8 @@ package cache
|
|
|
// It is safe for concurrent use if the underlying FillFunc is.
|
|
|
type None[K comparable, V any] struct{}
|
|
|
|
|
|
+var _ Cache[int, int] = None[int, int]{}
|
|
|
+
|
|
|
// Get always calls the provided FillFunc and returns what it does.
|
|
|
func (c None[K, V]) Get(_ K, f FillFunc[V]) (V, error) {
|
|
|
v, _, e := f()
|
|
|
@@ -15,4 +17,7 @@ func (c None[K, V]) Get(_ K, f FillFunc[V]) (V, error) {
|
|
|
}
|
|
|
|
|
|
// Forget implements Cache.
|
|
|
-func (c None[K, V]) Forget() {}
|
|
|
+func (None[K, V]) Forget(K) {}
|
|
|
+
|
|
|
+// Empty implements Cache.
|
|
|
+func (None[K, V]) Empty() {}
|