Skip to content

Commit

Permalink
image: replace math/rand with crypto/rand
Browse files Browse the repository at this point in the history
"rand.Read has been deprecated since Go 1.20 because it shouldn't be
used: For almost all use cases, [crypto/rand.Read] is more appropriate."
  • Loading branch information
achilleas-k committed Apr 10, 2024
1 parent 1fa056a commit 4657fbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/image/bootc_disk_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package image_test

import (
"crypto/rand"
"encoding/hex"
"encoding/json"
"math/rand"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -30,7 +30,7 @@ func TestBootcDiskImageNew(t *testing.T) {

func makeFakeDigest(t *testing.T) string {
data := make([]byte, 32)
_, err := rand.Read(data) // nolint:gosec
_, err := rand.Read(data)
require.Nil(t, err)
return "sha256:" + hex.EncodeToString(data[:])
}
Expand Down

0 comments on commit 4657fbd

Please sign in to comment.