This commit is contained in:
C菌
2022-04-28 03:15:01 +08:00
parent c113e38d82
commit 94cd2ce218
28 changed files with 1059 additions and 14 deletions

18
tests/lru.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
lru "github.com/hashicorp/golang-lru"
)
func main() {
l, _ := lru.New(10)
for i := 0; i < 100; i++ {
l.Add(i, i)
}
for l.Len() > 0 {
fmt.Println(l.RemoveOldest())
}
}