all: use math/rand/v2 more

Updates #11058

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2024-06-05 14:37:31 -07:00
committed by Maisem Ali
parent d2d459d442
commit 4a8cb1d9f3
23 changed files with 43 additions and 66 deletions

View File

@@ -15,7 +15,7 @@ import (
"io"
"log"
"math"
"math/rand"
"math/rand/v2"
"net"
"net/http"
"net/netip"
@@ -151,7 +151,7 @@ func probe(meta nodeMeta, conn io.ReadWriteCloser, fn measureFn) (*time.Duration
Port: 3478,
}
time.Sleep(time.Millisecond * time.Duration(rand.Intn(200))) // jitter across tx
time.Sleep(rand.N(200 * time.Millisecond)) // jitter across tx
rtt, err := fn(conn, ua)
if err != nil {
if isTemporaryOrTimeoutErr(err) {