Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
Andrea Spacca ec086b4eb3 Bump google.golang.org/api před 5 roky
..
simplelru Bump google.golang.org/api před 5 roky
.gitignore Bump google.golang.org/api před 5 roky
2q.go Bump google.golang.org/api před 5 roky
2q_test.go Bump google.golang.org/api před 5 roky
LICENSE Bump google.golang.org/api před 5 roky
README.md Bump google.golang.org/api před 5 roky
arc.go Bump google.golang.org/api před 5 roky
arc_test.go Bump google.golang.org/api před 5 roky
doc.go Bump google.golang.org/api před 5 roky
go.mod Bump google.golang.org/api před 5 roky
lru.go Bump google.golang.org/api před 5 roky
lru_test.go Bump google.golang.org/api před 5 roky

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