From b6f299974ffdf601421b53870a6935b3f5822e87 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 16 Dec 2024 17:21:20 +0100 Subject: [PATCH] Fix testutil.RandomName to use the full character set (#2020) ## Changes It was using first 12 chars, that does not seem intended. ## Tests Existing tests. --- internal/testutil/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/testutil/helpers.go b/internal/testutil/helpers.go index 69ed7595..019a8e61 100644 --- a/internal/testutil/helpers.go +++ b/internal/testutil/helpers.go @@ -23,7 +23,7 @@ func RandomName(prefix ...string) string { randLen := 12 b := make([]byte, randLen) for i := range b { - b[i] = charset[rand.Intn(randLen)] + b[i] = charset[rand.Intn(len(charset))] } if len(prefix) > 0 { return fmt.Sprintf("%s%s", strings.Join(prefix, ""), b)