go get github.com/asavt7/lrucache
//init cache with max keys size = 100
var cache lrucache.LRUCache = lrucache.NewLRUCache(100)
k := "0"
if v, ok := cache.Get(k); !ok {
//do dome work
v := "payload"
cache.Add(k, v)
}
// rm key in cache
cache.Remove(k)