aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/lookup.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-08-29 09:52:21 -0700
committerchrislu <chris.lu@gmail.com>2024-08-29 09:52:21 -0700
commita4b25a642d6b2ed6056496ffddce864100932f3d (patch)
tree181b5690d9d257e2833b257992be6d29f78fb817 /weed/operation/lookup.go
parentded5e084ea324c074e61bc74bba0bfaeb2af88d7 (diff)
downloadseaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.tar.xz
seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.zip
math/rand => math/rand/v2
Diffstat (limited to 'weed/operation/lookup.go')
-rw-r--r--weed/operation/lookup.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/operation/lookup.go b/weed/operation/lookup.go
index 6c89c17b1..9e9c719b5 100644
--- a/weed/operation/lookup.go
+++ b/weed/operation/lookup.go
@@ -6,7 +6,7 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/pb"
"google.golang.org/grpc"
- "math/rand"
+ "math/rand/v2"
"strings"
"time"
@@ -51,7 +51,7 @@ func LookupFileId(masterFn GetMasterFn, grpcDialOption grpc.DialOption, fileId s
if len(lookup.Locations) == 0 {
return "", jwt, errors.New("File Not Found")
}
- return "http://" + lookup.Locations[rand.Intn(len(lookup.Locations))].Url + "/" + fileId, lookup.Jwt, nil
+ return "http://" + lookup.Locations[rand.IntN(len(lookup.Locations))].Url + "/" + fileId, lookup.Jwt, nil
}
func LookupVolumeId(masterFn GetMasterFn, grpcDialOption grpc.DialOption, vid string) (*LookupResult, error) {