From b85fc903d7ea7a5573aa9dddfe02e1e06a061dc0 Mon Sep 17 00:00:00 2001 From: Michael Demmer Date: Thu, 11 Jul 2024 07:15:22 -0700 Subject: [PATCH] use math/rand/v2 Signed-off-by: Michael Demmer --- go/vt/vtgate/balancer/balancer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/balancer/balancer.go b/go/vt/vtgate/balancer/balancer.go index 30cf862f890..0e84cb66e21 100644 --- a/go/vt/vtgate/balancer/balancer.go +++ b/go/vt/vtgate/balancer/balancer.go @@ -19,7 +19,7 @@ package balancer import ( "encoding/json" "fmt" - "math/rand" + "math/rand/v2" "net/http" "sync" @@ -176,7 +176,7 @@ func (b *tabletBalancer) Pick(target *querypb.Target, tablets []*discovery.Table allocationMap, totalAllocation := b.getAllocation(target, tablets) - r := rand.Intn(totalAllocation) + r := rand.IntN(totalAllocation) for i := 0; i < numTablets; i++ { flow := allocationMap[tablets[i].Tablet.Alias.Uid] if r < flow {