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:
Nick Craig-Wood
2024-01-13 16:56:11 +00:00
parent 13fb2fb2ec
commit 938b43c26c
6 changed files with 0 additions and 75 deletions

View File

@ -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
}
}