LinkedHashMap supports dynamically capacity increasing.It's It's very simple to build an least recently used cache.
go get github.com/fangker/go-linkedHashMapimport "github.com/fangker/go-linkedHashMap"lhm := NewLinkedHashMap()lhm.Init(<int> initialCapacity, <bool> useLRU)The initial capacity parameter can suggest the length of hash arry
lhm.Put(<int> key, <interface> data)lhm.Get(<int> key, <interface> data)lhm.Get(<int> key, <interface> data)lhm.Base()You can override "RecordAccess" function to implement LRU Algorithm. The default "RecordAccess" method "MoveTo" will be invoked.