Murali Reddy 3c734fb96a
merge gobgp-update into master (#982)
* merge gobgp-update into master

* update travis.yaml go version:

* go get github.com/osrg/gobgp to build gobgp

* install git as go get needs it
2020-09-07 10:27:58 +05:30
..
2017-07-12 21:54:38 -05:00
2018-04-16 23:10:47 +05:30
2018-04-16 23:10:47 +05:30
2018-04-16 23:10:47 +05:30
2020-09-07 10:27:58 +05:30
2017-07-12 21:54:38 -05:00
2020-09-07 10:27:58 +05:30
2017-07-12 21:54:38 -05:00

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