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/server/master_server_handlers_admin.go | |
| parent | ded5e084ea324c074e61bc74bba0bfaeb2af88d7 (diff) | |
| download | seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.tar.xz seaweedfs-a4b25a642d6b2ed6056496ffddce864100932f3d.zip | |
math/rand => math/rand/v2
Diffstat (limited to 'weed/server/master_server_handlers_admin.go')
| -rw-r--r-- | weed/server/master_server_handlers_admin.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/server/master_server_handlers_admin.go b/weed/server/master_server_handlers_admin.go index 47bc1918a..452a4194e 100644 --- a/weed/server/master_server_handlers_admin.go +++ b/weed/server/master_server_handlers_admin.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" - "math/rand" + "math/rand/v2" "net/http" "strconv" @@ -113,7 +113,7 @@ func (ms *MasterServer) redirectHandler(w http.ResponseWriter, r *http.Request) collection := r.FormValue("collection") location := ms.findVolumeLocation(collection, vid) if location.Error == "" { - loc := location.Locations[rand.Intn(len(location.Locations))] + loc := location.Locations[rand.IntN(len(location.Locations))] url, _ := util_http.NormalizeUrl(loc.PublicUrl) if r.URL.RawQuery != "" { url = url + r.URL.Path + "?" + r.URL.RawQuery |
