From 00c9d5ec7660c4a46702af1b5a10c5e9f9e6bd99 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 7 May 2020 08:57:08 +0200 Subject: [PATCH] Create the node slice with the proper length Co-authored-by: Leo Antunes --- node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.go b/node.go index 6b106b5..53a096e 100644 --- a/node.go +++ b/node.go @@ -52,7 +52,7 @@ func decodeNodeMeta(b []byte) (nodeMeta, error) { func parseNodesMeta(rawNodes []node) []node { logrus.Info("cluster members:\n") - nodes := make([]node, 0) + nodes := make([]node, 0, len(rawNodes)) for _, node := range rawNodes { meta, err := decodeNodeMeta(node.Meta) if err != nil {