From 981768b7b03247cf2bc8c64c90374267993515c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Fri, 12 Aug 2022 10:58:00 +0800 Subject: [PATCH] - update redis --- const.go | 2 +- redis_curd.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/const.go b/const.go index 057c1bf..1807933 100644 --- a/const.go +++ b/const.go @@ -1,3 +1,3 @@ package dorm -const Version = "1.0.15" +const Version = "1.0.16" diff --git a/redis_curd.go b/redis_curd.go index e378bdc..92792e5 100644 --- a/redis_curd.go +++ b/redis_curd.go @@ -65,6 +65,9 @@ func (c *RedisClient) Del(ctx context.Context, keys ...string) *redis.IntCmd { // Keys 按前缀获取所有 key func (c *RedisClient) Keys(ctx context.Context, prefix string) *redis.SliceCmd { values, _ := c.Db.Keys(ctx, prefix).Result() + if len(values) <= 0 { + return &redis.SliceCmd{} + } keys := make([]string, 0, len(values)) for _, value := range values { keys = append(keys, value)