Skip to content

Commit

Permalink
golangci-lint: ensure math/rand/v2 is used instead of math/rand
Browse files Browse the repository at this point in the history
Use the depguard linter to disallow using the standard library math/rand
package and use v2 of the package instead.

Suggested-by: Marco Iorio <marco.iorio@isovalent.com>
Signed-off-by: Tobias Klauser <tobias@cilium.io>
  • Loading branch information
tklauser committed May 16, 2024
1 parent 5bfce8a commit 376a232
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ run:

# all available settings of specific linters
linters-settings:
depguard:
rules:
main:
deny:
- pkg: "math/rand$"
desc: "Use math/rand/v2 instead"
govet:
enable:
- nilness
Expand Down Expand Up @@ -107,6 +113,7 @@ issues:
linters:
disable-all: true
enable:
- depguard
- errorlint
- goerr113
- gofmt
Expand Down

0 comments on commit 376a232

Please sign in to comment.