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)