添加缓存
This commit is contained in:
+3
-3
@@ -9,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
cachex.NewCache().Set("test", "test", time.Second*5)
|
||||
cachex.NewCache("").Set("test", "test", time.Second*5)
|
||||
|
||||
da, err := cachex.NewCache().Get("test")
|
||||
da, err := cachex.NewCache("").Get("test")
|
||||
fmt.Println(da, err)
|
||||
|
||||
time.Sleep(time.Second * 5)
|
||||
da, err = cachex.NewCache().Get("test")
|
||||
da, err = cachex.NewCache("").Get("test")
|
||||
fmt.Println(da, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user