From 05c6f181f211413b2cbc343139a32e96fd773118 Mon Sep 17 00:00:00 2001 From: Pires Date: Tue, 8 Oct 2024 13:02:18 +0100 Subject: [PATCH] lint: replace math/rand.Read with crypto/rand.Read --- v2_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2_test.go b/v2_test.go index 57592b3..7fef556 100644 --- a/v2_test.go +++ b/v2_test.go @@ -3,6 +3,7 @@ package proxyproto import ( "bufio" "bytes" + iorand "crypto/rand" "encoding/binary" "math/rand" "reflect" @@ -51,7 +52,7 @@ var ( fixtureUnixV2 = append(lengthUnixBytes, fixtureUnixAddress...) fixtureTLV = func() []byte { tlv := make([]byte, 2+rand.Intn(1<<12)) // Not enough to overflow, at least size two - rand.Read(tlv) + _, _ = iorand.Read(tlv) return tlv }() fixtureIPv4V2TLV = fixtureWithTLV(lengthV4Bytes, fixtureIPv4Address, fixtureTLV)