commit | d1999049c11af3b53ee16428a13d1135658e680b | [log] [tgz] |
---|---|---|
author | Googler <noreply@google.com> | Wed Aug 09 01:46:37 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Aug 09 01:47:00 2023 -0700 |
tree | 4959a9b1d3f556b87723b6e50b0fa75c1f7e8b0a | |
parent | 8645ce8105795cd2e9f511b22a6c6db8429c615d [diff] |
No public description PiperOrigin-RevId: 555088427 Change-Id: Ic963090b2441067a291bfd5fc29f637847732631
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()))
}