Skip to content

Commit

Permalink
feat: update math/rand to math/rand/v2 (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathaniel Saxe <[email protected]>
  • Loading branch information
ef0xa and DireLines authored Jul 1, 2024
1 parent 00683ce commit 7537a51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/croc/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package croc
import (
"errors"
"fmt"
"math/rand/v2"
"log"
"math/rand"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -53,9 +53,9 @@ var SendCmd = &cobra.Command{
log.Fatal("Could not get list of relays. Please contact support for help!")
}

randIndex := rand.IntN(len(relays))
// Choose a random relay from the array
randomIndex := rand.Intn(len(relays))
relay := relays[randomIndex]
relay := relays[randIndex]

crocOptions := Options{
Curve: "p256",
Expand All @@ -82,7 +82,7 @@ var SendCmd = &cobra.Command{
crocOptions.SharedSecret = utils.GetRandomName()
}

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

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

0 comments on commit 7537a51

Please sign in to comment.