diff --git a/internal/datagen/generator.go b/internal/datagen/generator.go index 00805ee..b21a302 100644 --- a/internal/datagen/generator.go +++ b/internal/datagen/generator.go @@ -1,9 +1,9 @@ package datagen import ( + "crypto/rand" "crypto/sha256" "encoding/hex" - "math/rand" "github.com/dop251/goja" "go.k6.io/k6/js/modules" @@ -58,8 +58,10 @@ func (g *Generator) nextSlice() []byte { if g.buf == nil { // Allocate buffer with extra tail for sliding and populate it with random bytes g.buf = make([]byte, g.size+TailSize) - //nolint:staticcheck - rand.Read(g.buf) // Per docs, err is always nil here + _, err := rand.Read(g.buf) + if err != nil { + panic(err) + } } result := g.buf[g.offset : g.offset+g.size]