From f16cbd8c489babf234160759517ae2998f6595ce Mon Sep 17 00:00:00 2001 From: Pantelis Sampaziotis Date: Wed, 21 Sep 2022 11:32:27 +0200 Subject: [PATCH] use redis nil in rpop --- test_redis_client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_redis_client.go b/test_redis_client.go index a5f880c..59bf360 100644 --- a/test_redis_client.go +++ b/test_redis_client.go @@ -5,6 +5,8 @@ import ( "strings" "sync" "time" + + "github.com/go-redis/redis/v8" ) // TestRedisClient is a mock for redis @@ -140,11 +142,11 @@ func (client *TestRedisClient) RPop(key string) (value string, err error) { list, err := client.findList(key) // not a list if err != nil { - return "", ErrorNotFound + return "", err } // list is empty if len(list) == 0 { - return "", ErrorNotFound + return "", redis.Nil } // Remove the last element of source (tail)