Skip to content

Commit e4bddf3

Browse files
chore: add linter that catches math/rand imports (#42513) (#42604)
(cherry picked from commit 8cb39a0) Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
1 parent 467dc76 commit e4bddf3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.golangci.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,19 @@ linters:
6767
- noctx # noctx finds sending http request without context.Context
6868
- unconvert # Remove unnecessary type conversions
6969
- wastedassign # wastedassign finds wasted assignment statements.
70-
- gomodguard # check for blocked dependencies
71-
- depguard
70+
- gomodguard # check for blocked dependencies in go.mod
71+
- depguard # check for blocked dependencies in Go files
7272
- gomoddirectives
7373

7474
# all available settings of specific linters
7575
linters-settings:
7676
depguard:
7777
rules:
78+
main:
79+
list-mode: lax
80+
deny:
81+
- pkg: "math/rand$"
82+
desc: "superseded by math/rand/v2"
7883
apache-licensed-code:
7984
list-mode: lax
8085
files:

0 commit comments

Comments
 (0)