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)