hi,i can not get key when i test ristretto cache,Is there something wrong with my code?
var GCache *ristretto.Cache
func New() *ristretto.Cache {
var err error
icache, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 640000, // number of keys to track frequency of (10M).
MaxCost: 64000, // maximum cost of cache (1GB).
BufferItems: 64, // number of keys per Get buffer.
})
if err != nil {
panic(err)
}
return icache
}
func TestNew(t *testing.T) {
c := New()
require.NotNil(t, c)
require.True(t, c.Set("aaaadddffdfrergdfgdfg", 1, 0))
_,ok:=c.Get("aaaadddffdfrergdfgdfg")
require.True(t, ok)
}
Which versions of golang does this library support?