mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
avoid concurrenct use of rand.NewSource (#10543)
This commit is contained in:
@@ -30,11 +30,11 @@ import (
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
var randSrc = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
func newRandString(length int) string {
|
||||
randSrc := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
b := make([]byte, length)
|
||||
for i := range b {
|
||||
b[i] = charset[randSrc.Intn(len(charset))]
|
||||
|
||||
Reference in New Issue
Block a user