mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
all: stop using math/rand.Seed
Fixes #16428. Signed-off-by: Jes Cok <xigua67damn@gmail.com>
This commit is contained in:
@@ -16,7 +16,6 @@ package stringutil
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
// UniqueStrings returns a slice of randomly generated unique strings.
|
||||
@@ -45,7 +44,6 @@ func RandomStrings(slen uint, n int) (ss []string) {
|
||||
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
func RandString(l uint) string {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
s := make([]byte, l)
|
||||
for i := 0; i < int(l); i++ {
|
||||
s[i] = chars[rand.Intn(len(chars))]
|
||||
|
||||
Reference in New Issue
Block a user