forked from quic-go/quic-go
stop using math/rand.Seed and Read in tests, bump go.mod version to 1.20 (#3936)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ackhandler
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
@@ -16,10 +15,6 @@ func TestCrypto(t *testing.T) {
|
||||
|
||||
var mockCtrl *gomock.Controller
|
||||
|
||||
var _ = BeforeSuite(func() {
|
||||
rand.Seed(GinkgoRandomSeed())
|
||||
})
|
||||
|
||||
var _ = BeforeEach(func() {
|
||||
mockCtrl = gomock.NewController(GinkgoT())
|
||||
})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package handshake
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/protocol"
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"golang.org/x/exp/rand"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/protocol"
|
||||
"github.com/quic-go/quic-go/internal/qerr"
|
||||
"github.com/quic-go/quic-go/quicvarint"
|
||||
@@ -31,7 +32,7 @@ var _ = Describe("Transport Parameters", func() {
|
||||
}
|
||||
|
||||
BeforeEach(func() {
|
||||
rand.Seed(GinkgoRandomSeed())
|
||||
rand.Seed(uint64(GinkgoRandomSeed()))
|
||||
})
|
||||
|
||||
appendInitialSourceConnectionID := func(b []byte) []byte {
|
||||
|
||||
@@ -2,7 +2,6 @@ package wire
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
mrand "math/rand"
|
||||
|
||||
"golang.org/x/exp/rand"
|
||||
|
||||
@@ -15,7 +14,7 @@ import (
|
||||
var _ = Describe("Version Negotiation Packets", func() {
|
||||
randConnID := func(l int) protocol.ArbitraryLenConnectionID {
|
||||
b := make(protocol.ArbitraryLenConnectionID, l)
|
||||
_, err := mrand.Read(b)
|
||||
_, err := rand.Read(b)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
return b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user