mirror of https://github.com/databricks/cli.git
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:
parent
e5b836a6ac
commit
b6f299974f
|
@ -23,7 +23,7 @@ func RandomName(prefix ...string) string {
|
||||||
randLen := 12
|
randLen := 12
|
||||||
b := make([]byte, randLen)
|
b := make([]byte, randLen)
|
||||||
for i := range b {
|
for i := range b {
|
||||||
b[i] = charset[rand.Intn(randLen)]
|
b[i] = charset[rand.Intn(len(charset))]
|
||||||
}
|
}
|
||||||
if len(prefix) > 0 {
|
if len(prefix) > 0 {
|
||||||
return fmt.Sprintf("%s%s", strings.Join(prefix, ""), b)
|
return fmt.Sprintf("%s%s", strings.Join(prefix, ""), b)
|
||||||
|
|
Loading…
Reference in New Issue