mirror of https://github.com/docker/docs.git
Merge pull request #10795 from ahmetalpbalkan/integration-cli/makeRandomString
integration-cli: Seed rand in makeRandomString
This commit is contained in:
commit
546f481840
|
@ -235,8 +235,9 @@ func makeRandomString(n int) string {
|
|||
// make a really long string
|
||||
letters := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
b := make([]byte, n)
|
||||
r := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
|
||||
for i := range b {
|
||||
b[i] = letters[rand.Intn(len(letters))]
|
||||
b[i] = letters[r.Intn(len(letters))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue