Files
stash/vendor/github.com/hashicorp/golang-lru
kermieisinthehouse 265d5f4c70 Apple Silicon Support, Bump Go to 1.17, refactor docker/build/x86_64/Dockerfile (#1646)
* Bump Go to 1.17, refactor build/x86_64 Dockerfile to make better use of multi-stage
* Bump to 1.17 from 1.16
* Bump packr version, provide needed legacy env var
* Add apple silicon support, fix macos build chain
* Update unused travis ci
2021-09-08 15:30:15 +10:00
..
2019-02-09 16:56:50 -08:00
2019-02-09 16:56:50 -08:00
2019-02-09 16:56:50 -08:00
2019-02-09 16:56:50 -08:00
2019-02-09 16:56:50 -08:00
2019-02-09 16:56:50 -08:00
2019-05-27 12:34:26 -07:00
2019-02-09 16:56:50 -08:00

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