From cbf28f2f24f54fa3de06d7089c485c11b247e705 Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Wed, 5 Feb 2025 10:42:32 -0300 Subject: [PATCH] chore: add linter that catches math/rand imports (#42513) (cherry picked from commit 8cb39a073b1c3334afd3c9e5843e454c86c7f7e7) --- .golangci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c4ff00cc9092..19afb5342ecf 100755 --- a/.golangci.yml +++ b/.golangci.yml @@ -67,14 +67,19 @@ linters: - noctx # noctx finds sending http request without context.Context - unconvert # Remove unnecessary type conversions - wastedassign # wastedassign finds wasted assignment statements. - - gomodguard # check for blocked dependencies - - depguard + - gomodguard # check for blocked dependencies in go.mod + - depguard # check for blocked dependencies in Go files - gomoddirectives # all available settings of specific linters linters-settings: depguard: rules: + main: + list-mode: lax + deny: + - pkg: "math/rand$" + desc: "superseded by math/rand/v2" apache-licensed-code: list-mode: lax files: