Claude, use math/rand/v2 instead of math/rand (#42861)

This will only fire if Claude adds `math/rand` as an import.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated code style guidelines and enhanced linting configuration to
enforce stricter code quality standards.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Victor Lyuboslavsky 2026-04-02 13:20:43 -05:00 committed by GitHub
parent 667bac8cb8
commit 7acacf1dc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -23,3 +23,4 @@ MYSQL_TEST=1 go test -run TestFunctionName ./server/datastore/mysql/...
- Use `require` and `assert` from `github.com/stretchr/testify` in tests.
- Use `t.Context()` in tests instead of `context.Background()`.
- Use `any` instead of `interface{}`
- Use `math/rand/v2` instead of `math/rand`.

View file

@ -15,6 +15,7 @@ linters:
- testifylint
- nilaway
- setboolcheck
- depguard
settings:
gosec:
# Only enable rules that are too noisy on existing code but valuable for new code.
@ -31,6 +32,13 @@ linters:
- G704 # SSRF via taint analysis.
- G705 # XSS via taint analysis.
- G706 # Log injection via taint analysis.
depguard:
rules:
no-old-rand:
list-mode: lax
deny:
- pkg: math/rand$
desc: Use math/rand/v2 instead
custom:
nilaway:
type: module