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.
This commit is contained in:
Denis Bilenko 2024-12-16 17:21:20 +01:00 committed by GitHub
parent e5b836a6ac
commit b6f299974f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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)