-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
[DEPRECATION] Remove references to deprecated rand.Seed (#2650) #2950
Conversation
"fmt" | ||
"io" | ||
mrand "math/rand" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This choice was questioned on orangekame's PR.
Howver, this aligns pwgen_test.go
with the style found in rand.go
, of the same package.
Moreover, it only affects 3 references in a single test
9b672e2
to
6bfe602
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
If you can just lint it and accept our DCO and signoff your commit that'd be great.
Signed-off-by: Léo Hardt <leom.hardt@gmail.com>
fa4e66a
6bfe602
to
fa4e66a
Compare
Hi! Done the linting and signoff fixes. Since this is so close to October, would you mind if I reopen the PR on Tuesday? |
@lhardt No problem at all. See you in #hacktober :) |
Will be reopening it then. Thanks! |
Remove references to deprecated rand.Seed (#2650).
Context:
math/rand.Seed
is deprecated, andmath/rand
is already seeded by default.math/rand.Seed
will be a no-op, breaking the testTestPwgenNoCrand
.See method documentation in the link above for further info.
Code Changes:
Rand
variable, so that its value can be injected in tests;TestPwgenNoCrand
toTestPwgenNoCrandFallback
, to make the expected behaviour clearer;Shred
does not need to seed, nor doesTestLoadFromEnv
in config_test,TestPwgenNoCrandFallback
must restore the randomness so thatTestLoadFromEnv
can work properly.This also removes the side-effect that fsutil's Shred was overwriting the seed set by pwgen.