-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] Migrate from math/rand to math/rand/v2 #34685
base: main
Are you sure you want to change the base?
Conversation
still some work todo on this one will draft for now |
52fdfa1
to
5a4fb07
Compare
@mx-psi Two questions.
Thoughts? |
Yeah that seems okay, from https://go.dev/blog/chacha8rand#the-pcg-generator it seems like this is intended as the new default generator.
The godoc for
Why don't we use this? |
Yeah we can do this now, it was only added in 1.23 so when I was first looking at it it wasn't an option. |
Signed-off-by: Erik Westra <e.s.westra.95@gmail.com>
Ah, I didn't realize this was Go 1.23 only 😞 I guess we can either:
|
I think I'll go for the second option if that is okay. Do you usually mark a todo in code and reference an issue number as well |
Yes, that's the usual way of doing it: put a TODO comment with a link to the issue |
Signed-off-by: Erik Westra <e.s.westra.95@gmail.com>
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Description:
Migrating from math/rand to math/rand/v2.
Largely involves the following changes:
NOTE: There is one file where we now import both crypto/rand and math/rand/v2. I decided to alias both of them to avoid any confusion. So the imports in this package are
I thought this would be best because having only one aliased could still be mistakenly read.
Link to tracking Issue: #34676
Testing:
Running
make test
Documentation: