We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fae63f commit 9da5717Copy full SHA for 9da5717
1 file changed
policy/simple/example_test.go
@@ -49,6 +49,17 @@ func ExampleCache_Keys() {
49
// baz
50
}
51
52
+func ExampleCache_Len() {
53
+ c := simple.NewCache[string, int]()
54
+ c.Set("foo", 1)
55
+ c.Set("bar", 2)
56
+ c.Set("baz", 3)
57
+ len := c.Len()
58
+ fmt.Println(len)
59
+ // Output:
60
+ // 3
61
+}
62
+
63
func BenchmarkLenWithKeys(b *testing.B) {
64
c := simple.NewCache[string, int]()
65
c.Set("foo", 1)
0 commit comments