OSDN Git Service

add package
[bytom/vapor.git] / vendor / github.com / hashicorp / golang-lru / README.md
1 golang-lru
2 ==========
3
4 This provides the `lru` package which implements a fixed-size
5 thread safe LRU cache. It is based on the cache in Groupcache.
6
7 Documentation
8 =============
9
10 Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru)
11
12 Example
13 =======
14
15 Using the LRU is very simple:
16
17 ```go
18 l, _ := New(128)
19 for i := 0; i < 256; i++ {
20     l.Add(i, nil)
21 }
22 if l.Len() != 128 {
23     panic(fmt.Sprintf("bad len: %v", l.Len()))
24 }
25 ```