From d8d231e7253ffbdc3b6dbd55bbfefbd78b5dede6 Mon Sep 17 00:00:00 2001 From: 180909 Date: Thu, 23 Feb 2023 18:23:32 +0800 Subject: [PATCH] fix(selector): version NodeFilter append func (#2671) --- selector/filter/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selector/filter/version.go b/selector/filter/version.go index 41d56fbd3..21f8518ae 100644 --- a/selector/filter/version.go +++ b/selector/filter/version.go @@ -9,7 +9,7 @@ import ( // Version is version filter. func Version(version string) selector.NodeFilter { return func(_ context.Context, nodes []selector.Node) []selector.Node { - newNodes := nodes[:0] + newNodes := make([]selector.Node, 0) for _, n := range nodes { if n.Version() == version { newNodes = append(newNodes, n)