Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
Andrea Spacca ec086b4eb3 Bump google.golang.org/api 5 år sedan
..
simplelru Bump google.golang.org/api 5 år sedan
.gitignore Bump google.golang.org/api 5 år sedan
2q.go Bump google.golang.org/api 5 år sedan
2q_test.go Bump google.golang.org/api 5 år sedan
LICENSE Bump google.golang.org/api 5 år sedan
README.md Bump google.golang.org/api 5 år sedan
arc.go Bump google.golang.org/api 5 år sedan
arc_test.go Bump google.golang.org/api 5 år sedan
doc.go Bump google.golang.org/api 5 år sedan
go.mod Bump google.golang.org/api 5 år sedan
lru.go Bump google.golang.org/api 5 år sedan
lru_test.go Bump google.golang.org/api 5 år sedan

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