Update godoc link
1 file changed
tree: 56c3e271d045103a2585ffa1a52d3f0b8c3c1ce0
  1. .github/
  2. simplelru/
  3. .gitignore
  4. .golangci.yml
  5. 2q.go
  6. 2q_test.go
  7. arc.go
  8. arc_test.go
  9. doc.go
  10. go.mod
  11. LICENSE
  12. lru.go
  13. lru_test.go
  14. README.md
  15. testing.go
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 Go Packages

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()))
}