mirror of
https://github.com/distribution/distribution.git
synced 2025-09-05 08:51:18 +00:00
Handle rand deprecations in go 1.20
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package testutil
|
||||
import (
|
||||
"archive/tar"
|
||||
"bytes"
|
||||
crand "crypto/rand"
|
||||
"fmt"
|
||||
"io"
|
||||
mrand "math/rand"
|
||||
@@ -45,7 +46,7 @@ func CreateRandomTarFile() (rs io.ReadSeeker, dgst digest.Digest, err error) {
|
||||
randomData := make([]byte, fileSize)
|
||||
|
||||
// Fill up the buffer with some random data.
|
||||
n, err := mrand.Read(randomData)
|
||||
n, err := crand.Read(randomData)
|
||||
|
||||
if n != len(randomData) {
|
||||
return nil, "", fmt.Errorf("short read creating random reader: %v bytes != %v bytes", n, len(randomData))
|
||||
|
Reference in New Issue
Block a user