♻️ Use math/rand/v2
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pull_request_closed/build Pipeline was successful

This commit is contained in:
Ada 2024-02-19 00:32:27 +01:00
parent 7ac2732d25
commit 36e959f5e2
Signed by: ada
GPG key ID: 6A7F898157C6DE6E

View file

@ -4,7 +4,7 @@ import (
"crypto/rand" "crypto/rand"
"encoding/hex" "encoding/hex"
"log" "log"
mathrand "math/rand" mathrand "math/rand/v2"
"strconv" "strconv"
"strings" "strings"
) )
@ -14,7 +14,7 @@ func GenerateUrl(length uint8) string {
listChars := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") listChars := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
b := make([]rune, length) b := make([]rune, length)
for i := range b { for i := range b {
b[i] = listChars[mathrand.Intn(len(listChars))] b[i] = listChars[mathrand.IntN(len(listChars))]
} }
return string(b) return string(b)