You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The math/rand/v2 package is not cryptographically secure, this is why you get the warning. You can check the documentation for more details https://pkg.go.dev/math/rand/v2#pkg-overview (See last sentence from Overview section).
The math/rand/v2 package is not cryptographically secure, this is why you get the warning. You can check the documentation for more details https://pkg.go.dev/math/rand/v2#pkg-overview (See last sentence from Overview section).
It's depressing that crypto/rand is overly hard to use when math/rand/v2 exists. 99+% of the times, using a predictable RNG is fine in my programs, but of course gosec can't know. Is there a project-level way of disabling G404?
Summary
I am getting G404 lint warnings despite using
math/rand/v2
Steps to reproduce the behavior
Example program:
gosec version
v2.21.4
Go version (output of 'go version')
go version go1.23.4 linux/amd64
Operating system / Environment
Debian testing (trixie)
Expected behavior
No warning G404 when using
math/rand/v2
Actual behavior
See above
The text was updated successfully, but these errors were encountered: