File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ linters:
4747 - noctx # noctx finds sending http request without context.Context
4848 - unconvert # Remove unnecessary type conversions
4949 - wastedassign # wastedassign finds wasted assignment statements.
50- - gomodguard # check for blocked dependencies
50+ - gomodguard # check for blocked dependencies in go.mod
51+ - depguard # check for blocked dependencies in Go files
5152
5253# all available settings of specific linters
5354linters-settings :
@@ -115,6 +116,14 @@ linters-settings:
115116 - github.com/elastic/beats/v7 :
116117 reason : " There must be no Beats dependency"
117118
119+ depguard :
120+ rules :
121+ main :
122+ list-mode : lax
123+ deny :
124+ - pkg : " math/rand$"
125+ desc : " superseded by math/rand/v2"
126+
118127 staticcheck :
119128 # Select the Go version to target. The default is '1.13'.
120129 go : " 1.22.11"
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import (
2929 "encoding/pem"
3030 "fmt"
3131 "math/big"
32- "math/rand"
32+ "math/rand/v2 "
3333 "net"
3434 "os"
3535 "path/filepath"
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ package transport
2020import (
2121 "context"
2222 "fmt"
23- "math/rand"
23+ "math/rand/v2 "
2424 "net"
2525 "strings"
2626)
You can’t perform that action at this time.
0 commit comments