bump to Go 1.20 and rm deprecated rand.Seed
This commit is contained in:
@@ -2,9 +2,7 @@ package util
|
||||
|
||||
import (
|
||||
"io"
|
||||
"math/rand"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Return a slice of range [0, n)
|
||||
@@ -16,11 +14,6 @@ func Range(n int) []int {
|
||||
return s
|
||||
}
|
||||
|
||||
func ShuffleSlice(a []int) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
rand.Shuffle(len(a), func(i, j int) { a[i], a[j] = a[j], a[i] })
|
||||
}
|
||||
|
||||
func CopyFile(srcPath, dstPath string) error {
|
||||
fin, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user