This commit is contained in:
Yun
2023-11-24 22:28:22 +08:00
commit f52d18c16b
3 changed files with 91 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package cachex_test
import (
"fmt"
"testing"
"time"
"code.yun.ink/pkg/cachex"
)
func TestCache(t *testing.T) {
cachex.NewCache().Set("test", "test", time.Second*5)
da := cachex.NewCache().Get("test")
fmt.Println(da)
time.Sleep(time.Second *5)
da = cachex.NewCache().Get("test")
fmt.Println(da)
}