package localcache import ( "context" "fmt" "testing" "time" ) func TestNewLocalCache(t *testing.T) { Register("test", func(context context.Context, cache Cache) { fmt.Println(time.Now().Format("2006-01-02 15:04:05")) for index, _ := range [100]int{} { cache.Put(uint64(index), fmt.Sprintf("cache-%d", index)) } panic("1111") }) Start() tick := time.NewTicker(time.Millisecond * 500) for { <-tick.C fmt.Println(Get("test", uint64(1))) } }