Skip to content

Commit 7537a51

Browse files
ef0xaDireLines
andauthored
feat: update math/rand to math/rand/v2 (#153)
Co-authored-by: Nathaniel Saxe <[email protected]>
1 parent 00683ce commit 7537a51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/croc/send.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package croc
33
import (
44
"errors"
55
"fmt"
6+
"math/rand/v2"
67
"log"
7-
"math/rand"
88
"os"
99
"path/filepath"
1010
"strconv"
@@ -53,9 +53,9 @@ var SendCmd = &cobra.Command{
5353
log.Fatal("Could not get list of relays. Please contact support for help!")
5454
}
5555

56+
randIndex := rand.IntN(len(relays))
5657
// Choose a random relay from the array
57-
randomIndex := rand.Intn(len(relays))
58-
relay := relays[randomIndex]
58+
relay := relays[randIndex]
5959

6060
crocOptions := Options{
6161
Curve: "p256",
@@ -82,7 +82,7 @@ var SendCmd = &cobra.Command{
8282
crocOptions.SharedSecret = utils.GetRandomName()
8383
}
8484

85-
crocOptions.SharedSecret = crocOptions.SharedSecret + "-" + strconv.Itoa(randomIndex)
85+
crocOptions.SharedSecret = crocOptions.SharedSecret + "-" + strconv.Itoa(randIndex)
8686
fmt.Println(crocOptions.SharedSecret) // output to stdout so user or send-ssh can see it
8787

8888
minimalFileInfos, emptyFoldersToTransfer, totalNumberFolders, err := GetFilesInfo(args, crocOptions.ZipFolder)

0 commit comments

Comments
 (0)