feat(libbeat): use math/rand/v2 and drop seed init#42025
Merged
kruskall merged 13 commits intoelastic:mainfrom Jan 28, 2025
Merged
feat(libbeat): use math/rand/v2 and drop seed init#42025kruskall merged 13 commits intoelastic:mainfrom
kruskall merged 13 commits intoelastic:mainfrom
Conversation
Since go 1.20 the rand package automatically seeds the global random number generator with a random value. remove deprecate methods and use rand v2 api in libbeat
|
This pull request doesn't have a |
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Contributor
|
|
it was removed in v4
mauri870
approved these changes
Jan 27, 2025
efd6
reviewed
Jan 27, 2025
Comment on lines
-186
to
-195
| func init() { | ||
| initRand() | ||
| } | ||
|
|
||
| // initRand initializes the runtime random number generator seed using | ||
| // global, shared cryptographically strong pseudo random number generator. | ||
| // | ||
| // On linux Reader might use getrandom(2) or /udev/random. On windows systems | ||
| // CryptGenRandom is used. | ||
| func initRand() { |
Contributor
There was a problem hiding this comment.
Thank you for removing this. Even without the v2 changes this was unsound.
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
mergify bot
pushed a commit
that referenced
this pull request
Jan 28, 2025
* feat(libbeat): use math/rand/v2 and drop seed init Since go 1.20 the rand package automatically seeds the global random number generator with a random value. remove deprecate methods and use rand v2 api in libbeat * ci: bump golangci-lint to fix errors * ci(golangci): remove skip-go-installation option it was removed in v4 * Update golangci-lint.yml * Update golangci-lint.yml * Update golangci-lint.yml * lint: replace rand with t tempdir * Update client_integration_test.go * lint: fix linter issues * lint: fix linter issues * Apply suggestions from code review Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> (cherry picked from commit 12c36bd)
6 tasks
8 tasks
Merged
8 tasks
6 tasks
This was referenced Feb 5, 2025
rdner
pushed a commit
that referenced
this pull request
Feb 14, 2025
* feat(libbeat): use math/rand/v2 and drop seed init Since go 1.20 the rand package automatically seeds the global random number generator with a random value. remove deprecate methods and use rand v2 api in libbeat * ci: bump golangci-lint to fix errors * ci(golangci): remove skip-go-installation option it was removed in v4 * Update golangci-lint.yml * Update golangci-lint.yml * Update golangci-lint.yml * lint: replace rand with t tempdir * Update client_integration_test.go * lint: fix linter issues * lint: fix linter issues * Apply suggestions from code review Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co> (cherry picked from commit 12c36bd) Co-authored-by: kruskall <99559985+kruskall@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Since go 1.20 the rand package automatically seeds the global random number generator with a random value.
remove deprecate methods and use rand v2 api in libbeat
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs