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 Bump some dependencies to more recent versions (and tagged if available) 2018-07-25 14:16:41 +02:00
LICENSE Add a common interface between different Kubernetes Stack API versions and use it in kubernetes stack commands 2018-04-30 11:27:22 +02:00
README.md Add a common interface between different Kubernetes Stack API versions and use it in kubernetes stack commands 2018-04-30 11:27:22 +02:00
arc.go Bump some dependencies to more recent versions (and tagged if available) 2018-07-25 14:16:41 +02:00
doc.go Bump some dependencies to more recent versions (and tagged if available) 2018-07-25 14:16:41 +02:00
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()))
}