-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add linter that catches math/rand imports #42513
Conversation
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
(cherry picked from commit 8cb39a0)
(cherry picked from commit 8cb39a0)
Proposed commit message
This is a follow up to #42025 that migrated from math/rand to the newer math/rand/v2 package. Currently there is nothing preventing contributors to commiting code using math/rand and regressing these changes.
There is still code in beats that use math/rand, but it is mainly in tests. Since the linter only runs on new code I'm not fixing it here.
Introduce a linter that catches math/rand imports in Go files.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Logs
Offending code gets warned like this: