From 68c4e181b0d08fbe04931df51218584df2482099 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Wed, 9 Aug 2023 01:20:05 -0700 Subject: [PATCH] [chore] preallocate slices (#24957) --- processor/redactionprocessor/processor_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processor/redactionprocessor/processor_test.go b/processor/redactionprocessor/processor_test.go index 1c2ac7c37d81..9cac82dfa703 100644 --- a/processor/redactionprocessor/processor_test.go +++ b/processor/redactionprocessor/processor_test.go @@ -133,7 +133,7 @@ func TestRedactSummaryDebug(t *testing.T) { outTraces := runTest(t, allowed, redacted, masked, ignored, config) attr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes() - var deleted []string + deleted := make([]string, 0, len(redacted)) for k := range redacted { _, ok := attr.Get(k) assert.False(t, ok) @@ -188,7 +188,7 @@ func TestRedactSummaryInfo(t *testing.T) { outTraces := runTest(t, allowed, redacted, masked, ignored, config) attr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes() - var deleted []string + deleted := make([]string, 0, len(redacted)) for k := range redacted { _, ok := attr.Get(k) assert.False(t, ok) @@ -299,7 +299,7 @@ func TestMultipleBlockValues(t *testing.T) { outTraces := runTest(t, allowed, redacted, masked, nil, config) attr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes() - var deleted []string + deleted := make([]string, 0, len(redacted)) for k := range redacted { _, ok := attr.Get(k) assert.False(t, ok)