This commit is contained in:
Minh Nguyen 2022-03-25 14:35:44 +07:00
parent 562d8c6f64
commit 1ab40b99b8
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,9 @@
package redisdb package redisdb
import "context" import (
"context"
"fmt"
)
// GetWithPrefixPattern ... // GetWithPrefixPattern ...
func GetWithPrefixPattern(pattern string, limit int64) (keys []string, values []string) { func GetWithPrefixPattern(pattern string, limit int64) (keys []string, values []string) {
@ -16,10 +19,12 @@ func GetWithPrefixPattern(pattern string, limit int64) (keys []string, values []
keys, cursor, err = rdb.Scan(ctx, cursor, pattern, limit).Result() keys, cursor, err = rdb.Scan(ctx, cursor, pattern, limit).Result()
if err != nil { if err != nil {
fmt.Println("err redis scan: ", err.Error())
return return
} }
if len(keys) == 0 { if len(keys) == 0 {
fmt.Println("NO keys")
return return
} }