iwita b9152718d2 new version 5 vuotta sitten
..
simplelru b9152718d2 new version 5 vuotta sitten
.gitignore b9152718d2 new version 5 vuotta sitten
2q.go b9152718d2 new version 5 vuotta sitten
BUILD b9152718d2 new version 5 vuotta sitten
LICENSE b9152718d2 new version 5 vuotta sitten
README.md b9152718d2 new version 5 vuotta sitten
arc.go b9152718d2 new version 5 vuotta sitten
doc.go b9152718d2 new version 5 vuotta sitten
go.mod b9152718d2 new version 5 vuotta sitten
lru.go b9152718d2 new version 5 vuotta sitten

README.md

golang-lru

This provides the lru package which implements a fixed-size thread safe LRU cache. It is based on the cache in Groupcache.

Documentation

Full docs are available on Godoc

Example

Using the LRU is very simple:

l, _ := New(128)
for i := 0; i < 256; i++ {
    l.Add(i, nil)
}
if l.Len() != 128 {
    panic(fmt.Sprintf("bad len: %v", l.Len()))
}