From bcef0d823f2c8dee231057b80a6e0f0d44529fc9 Mon Sep 17 00:00:00 2001 From: dmitri-lerko Date: Tue, 7 Jun 2022 20:17:50 +0100 Subject: [PATCH] fix: error message for SlowLog conversion (#612) Fix incorrect offset in error message for SlowLog conversion. --- redis/reply.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/reply.go b/redis/reply.go index 11a8aa16..7a2b3fef 100644 --- a/redis/reply.go +++ b/redis/reply.go @@ -614,13 +614,13 @@ func SlowLogs(result interface{}, err error) ([]SlowLog, error) { timestamp, ok := rawLog[1].(int64) if !ok { - return nil, fmt.Errorf("redigo: slowlog element[1] not an int64, got %T", rawLog[0]) + return nil, fmt.Errorf("redigo: slowlog element[1] not an int64, got %T", rawLog[1]) } log.Time = time.Unix(timestamp, 0) duration, ok := rawLog[2].(int64) if !ok { - return nil, fmt.Errorf("redigo: slowlog element[2] not an int64, got %T", rawLog[0]) + return nil, fmt.Errorf("redigo: slowlog element[2] not an int64, got %T", rawLog[2]) } log.ExecutionTime = time.Duration(duration) * time.Microsecond