From dd073b06455ff625fae378f5cd6c3b6bd7831805 Mon Sep 17 00:00:00 2001 From: NaNShaner Date: Tue, 30 Apr 2024 17:10:57 +0800 Subject: [PATCH] bugfix: Fix the issue with the result format returned by the randomkey command --- database/string.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/database/string.go b/database/string.go index cd12bed6..48e38040 100644 --- a/database/string.go +++ b/database/string.go @@ -831,8 +831,7 @@ func getRandomKey(db *DB, args [][]byte) redis.Reply { if len(k) == 0 { return &protocol.NullBulkReply{} } - var key []byte - return protocol.MakeBulkReply(strconv.AppendQuote(key, k[0])) + return protocol.MakeBulkReply([]byte(k[0])) } func init() {