chore: update math/rand to math/rand/v2

This commit is contained in:
nadoo committed 2025-02-28 00:40:20 +08:00
1 parent 8e81e09a8f
commit 6aee7b35c0
22 files changed
+75 -80

No files matched your search

+1 -1
View File
@@ -179,7 +179,7 @@ func (c *Client) exchange(qname string, reqBytes []byte, preferTCP bool) (
ups := c.UpStream(qname)
server = ups.Server()
for i := 0; i < ups.Len(); i++ {
for range ups.Len() {
var rc net.Conn
rc, err = dialer.Dial(network, server)
if err != nil {
+2 -2
View File
@@ -5,7 +5,7 @@ import (
"encoding/binary"
"errors"
"io"
"math/rand"
"math/rand/v2"
"net/netip"
"strings"
)
@@ -146,7 +146,7 @@ func UnmarshalMessage(b []byte) (*Message, error) {
// resp answers
rrIdx := HeaderLen + qLen
for i := 0; i < int(m.Header.ANCOUNT); i++ {
for range int(m.Header.ANCOUNT) {
rr := &RR{}
rrLen, err := m.UnmarshalRR(rrIdx, rr)
if err != nil {