diff options
| author | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-08-29 09:52:21 -0700 |
| commit | a4b25a642d6b2ed6056496ffddce864100932f3d (patch) | |
| tree | 181b5690d9d257e2833b257992be6d29f78fb817 /weed/operation/submit.go | |
| parent | ded5e084ea324c074e61bc74bba0bfaeb2af88d7 (diff) | |
| download | seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.tar.xz seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.zip | |
math/rand => math/rand/v2
Diffstat (limited to 'weed/operation/submit.go')
| -rw-r--r-- | weed/operation/submit.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/operation/submit.go b/weed/operation/submit.go index 66d5542af..73e50cc48 100644 --- a/weed/operation/submit.go +++ b/weed/operation/submit.go @@ -4,7 +4,7 @@ import ( "context" "github.com/seaweedfs/seaweedfs/weed/pb" "io" - "math/rand" + "math/rand/v2" "mime" "net/url" "os" @@ -236,7 +236,7 @@ func genFileUrl(ret *AssignResult, id string, usePublicUrl bool) string { fileUrl = "http://" + ret.PublicUrl + "/" + id } for _, replica := range ret.Replicas { - if rand.Intn(len(ret.Replicas)+1) == 0 { + if rand.IntN(len(ret.Replicas)+1) == 0 { fileUrl = "http://" + replica.Url + "/" + id if usePublicUrl { fileUrl = "http://" + replica.PublicUrl + "/" + id |
