Skip to content

Commit 1c6929c

Browse files
committed
Remove use of crypto rand in tests
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
1 parent cce0a46 commit 1c6929c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

archive/compression/compression_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ package compression
1818

1919
import (
2020
"bytes"
21-
"crypto/rand"
2221
"io/ioutil"
22+
"math/rand"
2323
"testing"
2424
)
2525

content/local/store_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ import (
2020
"bufio"
2121
"bytes"
2222
"context"
23-
"crypto/rand"
2423
_ "crypto/sha256" // required for digest package
2524
"fmt"
2625
"io"
2726
"io/ioutil"
28-
mrand "math/rand"
27+
"math/rand"
2928
"os"
3029
"path/filepath"
3130
"reflect"
@@ -266,9 +265,9 @@ func generateBlobs(t checker, nblobs, maxsize int64) map[digest.Digest][]byte {
266265
blobs := map[digest.Digest][]byte{}
267266

268267
for i := int64(0); i < nblobs; i++ {
269-
p := make([]byte, mrand.Int63n(maxsize))
268+
p := make([]byte, rand.Int63n(maxsize))
270269

271-
if _, err := mrand.Read(p); err != nil {
270+
if _, err := rand.Read(p); err != nil {
272271
t.Fatal(err)
273272
}
274273

0 commit comments

Comments
 (0)