From ecdff703541fb10a11906dd1895086716cafec11 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Tue, 2 Sep 2025 10:41:06 +0300 Subject: [PATCH] lint: add missing prealloc to backend lookup test (#7510) --- plugin/backend_lookup_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/backend_lookup_test.go b/plugin/backend_lookup_test.go index a1dd49c63..604a610f4 100644 --- a/plugin/backend_lookup_test.go +++ b/plugin/backend_lookup_test.go @@ -213,8 +213,9 @@ func TestCNAMEHostIsNameAndIpIgnored(t *testing.T) { func TestCNAMEChainLimitAndLoop(t *testing.T) { // Construct internal CNAME chain longer than maxCnameChainLength and ensure truncation of chain - var names []string - for i := range maxCnameChainLength + 2 { + chainLength := maxCnameChainLength + 2 + names := make([]string, 0, chainLength) + for i := range chainLength { names = append(names, fmt.Sprintf("c%d.example.org.", i)) } chain := map[string]string{}