1
0
Fork 0
forked from forgejo/forgejo

Replace deprecated math/rand functions (#30733)

Suggested by logs in #30729

- Remove `math/rand.Seed`
`rand.Seed is deprecated: As of Go 1.20 there is no reason to call Seed
with a random value.`
- Replace `math/rand.Read`
`rand.Read is deprecated: For almost all use cases, [crypto/rand.Read]
is more appropriate.`
- Replace `math/rand` with `math/rand/v2`, which is available since Go
1.22

(cherry picked from commit 7b8e418da1e082786b844562a05864ec1177ce97)
This commit is contained in:
Chongyi Zheng 2024-04-27 12:50:35 -04:00 committed by Earl Warren
parent 2d2c18f0bd
commit 781789e779
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
4 changed files with 10 additions and 16 deletions

View file

@ -5,8 +5,8 @@ package user_test
import (
"context"
"crypto/rand"
"fmt"
"math/rand"
"strings"
"testing"
"time"