mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 13:55:15 +02:00
build: remove random.Seed since random generator is seeded automatically in go1.20
Now that the minimum version is go1.20 we can stop seeding the random number generator.
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package random
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -49,16 +48,3 @@ func TestPasswordDuplicates(t *testing.T) {
|
||||
seen[s] = true
|
||||
}
|
||||
}
|
||||
|
||||
func TestSeed(t *testing.T) {
|
||||
// seed 100 times and check the first random number doesn't repeat
|
||||
// This test could fail with a probability of ~ 10**-15
|
||||
const n = 100
|
||||
var seen = map[int64]bool{}
|
||||
for i := 0; i < n; i++ {
|
||||
assert.NoError(t, Seed())
|
||||
first := rand.Int63()
|
||||
assert.False(t, seen[first])
|
||||
seen[first] = true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user