]> source.dussan.org Git - gitea.git/commit
Replace deprecated `math/rand` functions (#30733) v1.23.0-dev
authorChongyi Zheng <git@zcy.dev>
Sat, 27 Apr 2024 16:50:35 +0000 (12:50 -0400)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 16:50:35 +0000 (18:50 +0200)
commit7b8e418da1e082786b844562a05864ec1177ce97
treec42f1034b7ae6a48421f7ddd19a534ab1e7031e6
parent8de2992ffba8cc627757ecea1e002a55581113d2
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
models/user/user_test.go
modules/auth/password/pwn/pwn_test.go
tests/integration/benchmarks_test.go
tests/integration/git_test.go