Remove deprecated method. (#2481)
This commit is contained in:
parent
8fa4520376
commit
56754094ea
|
|
@ -5,17 +5,17 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
rand.Seed(time.Now().UnixNano())
|
|
||||||
}
|
|
||||||
|
|
||||||
const letterBytes = "abcdefghijklmnopqrstuvwxyz"
|
const letterBytes = "abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
||||||
|
var (
|
||||||
|
random = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||||
|
)
|
||||||
|
|
||||||
// Copied from https://stackoverflow.com/a/31832326 with thanks
|
// Copied from https://stackoverflow.com/a/31832326 with thanks
|
||||||
func RandStringBytesRmndr(n int) string {
|
func RandStringBytesRmndr(n int) string {
|
||||||
b := make([]byte, n)
|
b := make([]byte, n)
|
||||||
for i := range b {
|
for i := range b {
|
||||||
b[i] = letterBytes[rand.Int63()%int64(len(letterBytes))]
|
b[i] = letterBytes[random.Int63()%int64(len(letterBytes))]
|
||||||
}
|
}
|
||||||
return string(b)
|
return string(b)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue