Open lhardt opened 3 days ago
Remove references to deprecated rand.Seed (#2650).
math/rand.Seed
math/rand
TestPwgenNoCrand
See method documentation in the link above for further info.
Rand
TestPwgenNoCrandFallback
Shred
TestLoadFromEnv
This also removes the side-effect that fsutil's Shred was overwriting the seed set by pwgen.
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 :)
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.