mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
all: use math/rand/v2 more
Updates #11058 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"math/rand"
|
||||
"math/rand/v2"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -74,8 +74,7 @@ func getDigitalOceanResolver() string {
|
||||
// Randomly select one of the available resolvers so we don't overload
|
||||
// one of them by sending all traffic there.
|
||||
return digitalOceanResolver.Get(func() string {
|
||||
rn := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
return digitalOceanResolvers[rn.Intn(len(digitalOceanResolvers))]
|
||||
return digitalOceanResolvers[rand.IntN(len(digitalOceanResolvers))]
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user