Handle rand deprecations in go 1.20

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
James Hewitt 2023-08-27 11:06:16 +01:00
parent 0eb8fee87e
commit 1a3e73cb84
No known key found for this signature in database
GPG key ID: EA6C3C654B6193E4
8 changed files with 12 additions and 10 deletions

View file

@ -21,6 +21,7 @@ import (
)
var sbsMu sync.Mutex
var randSource rand.Rand
type statsBlobStore struct {
stats map[string]int
@ -189,13 +190,13 @@ func makeTestEnv(t *testing.T, name string) *testEnv {
func makeBlob(size int) []byte {
blob := make([]byte, size)
for i := 0; i < size; i++ {
blob[i] = byte('A' + rand.Int()%48)
blob[i] = byte('A' + randSource.Int()%48)
}
return blob
}
func init() {
rand.Seed(42)
randSource = *rand.New(rand.NewSource(42))
}
func populate(t *testing.T, te *testEnv, blobCount, size, numUnique int) {