From 026bba12218706b88c935adcaf34ded607744765 Mon Sep 17 00:00:00 2001 From: lizifeng Date: Wed, 17 May 2023 19:14:45 +0800 Subject: [PATCH] update --- myredis/redis_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/myredis/redis_test.go b/myredis/redis_test.go index d4cbb39..9680d14 100644 --- a/myredis/redis_test.go +++ b/myredis/redis_test.go @@ -1,6 +1,7 @@ package myredis import ( + "context" "fmt" "testing" "time" @@ -22,14 +23,14 @@ func TestRedis(t *testing.T) { } defer redis.Close() - set, err := redis.Set("name", "qwe123", time.Minute) + set, err := redis.Set(context.Background(), "name", "qwe123", time.Minute).Result() if err != nil { fmt.Println(err) return } fmt.Println(set) - get, err := redis.Get("name") + get, err := redis.Get(context.Background(), "name").Result() if err != nil { fmt.Println(err) return