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
8 changed files with 12 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ package storage
import (
"bytes"
crand "crypto/rand"
"io"
mrand "math/rand"
"testing"
@@ -14,7 +15,7 @@ import (
func TestSimpleRead(t *testing.T) {
ctx := context.Background()
content := make([]byte, 1<<20)
n, err := mrand.Read(content)
n, err := crand.Read(content)
if err != nil {
t.Fatalf("unexpected error building random data: %v", err)
}