From 2aeddfaa28c6b35eb568e81a561125666b16039a Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Fri, 29 Jul 2022 14:28:22 +0300 Subject: [PATCH] fix: fix ClusterSlots to read full metadata --- command.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/command.go b/command.go index a6f74dbe..319bfba2 100644 --- a/command.go +++ b/command.go @@ -2822,19 +2822,14 @@ func (cmd *ClusterSlotsCmd) readReply(rd *proto.Reader) error { } if nn >= 4 { - networkingMetadata := make(map[string]string) - metadataLength, err := rd.ReadMapLen() if err != nil { return err } - if metadataLength%2 != 0 { - return fmt.Errorf( - "got %d elements in metadata, expected an even number", metadataLength) - } + networkingMetadata := make(map[string]string, metadataLength) - for i := 0; i < metadataLength; i += 2 { + for i := 0; i < metadataLength; i++ { key, err := rd.ReadString() if err != nil { return err