up
This commit is contained in:
18
tests/lru.go
Normal file
18
tests/lru.go
Normal 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())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user