From 588c970159a1ca016dbd22093b72ff71d8500f69 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 11 Nov 2024 17:21:09 +0300 Subject: [PATCH] PMM-9870 fix linter. --- exporter/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/common.go b/exporter/common.go index 4512d127..cf755c03 100644 --- a/exporter/common.go +++ b/exporter/common.go @@ -106,7 +106,7 @@ func makeExcludeFilter(exclude []string) *primitive.E { if len(exclude) == 0 { return nil } - var filterExpressions []bson.D + filterExpressions := make([]bson.D, 0, len(exclude)) for _, dbname := range exclude { filterExpressions = append(filterExpressions, bson.D{{Key: "name", Value: bson.D{{Key: "$ne", Value: dbname}}}}, @@ -117,12 +117,12 @@ func makeExcludeFilter(exclude []string) *primitive.E { } func makeDBsFilter(filterInNamespaces []string) *primitive.E { - filterExpressions := []bson.D{} nss := removeEmptyStrings(filterInNamespaces) if len(nss) == 0 { return nil } + filterExpressions := make([]bson.D, 0, len(nss)) for _, namespace := range nss { parts := strings.Split(namespace, ".") filterExpressions = append(filterExpressions,