wlf f051014ac2 提交正常运行的所有代码 | 1 year ago | |
---|---|---|
.. | ||
simplelru | 1 year ago | |
2q.go | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
arc.go | 1 year ago | |
doc.go | 1 year ago | |
go.mod | 1 year ago | |
lru.go | 1 year ago |
This provides the lru
package which implements a fixed-size
thread safe LRU cache. It is based on the cache in Groupcache.
Full docs are available on Godoc
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()))
}