DockerCLI/vendor/github.com/hashicorp/golang-lru
Sebastiaan van Stijn 4b267469b9
bump hashicorp/golang-lru v0.5.3
full diff: 0fb14efe8c...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-12 21:21:22 +01:00
..
simplelru bump hashicorp/golang-lru v0.5.3 2019-12-12 21:21:22 +01:00
2q.go
LICENSE
README.md
arc.go
doc.go
go.mod bump hashicorp/golang-lru v0.5.3 2019-12-12 21:21:22 +01:00
lru.go bump hashicorp/golang-lru v0.5.3 2019-12-12 21:21:22 +01:00

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