4 ms·
Ouch, apologies for that. We changed goimports to prefer crypto/rand back in 2016, so I'm not entirely sure what happened during your refactoring. Perhaps code
by rsc 2y ago
Ouch, apologies for that. We changed goimports to prefer crypto/rand back in 2016, so I'm not entirely sure what happened during your refactoring. Perhaps code that used other math/rand-only APIs ended up in the same file. https://go-review.googlesource.com/24847 https://go-review.googlesource.com/24847
Anyway, I'm glad we're cleaning all this up!
- nickcw 2y agoYes I'm pretty sure that is what happened. I was consolidating random functions into one file which was already using math/rand so when I moved the function which was using crypto/rand there it picked up the math/rand import. So not goimports problem, my problem for expecting goimports to magically do the right thing like it usually does!
- mholt 2y agoEver since 2016 I actually do a named import for "math/rand" now by calling it "mathrand" or "weakrand" just to be sure I don't accidentally use it for anything secure. Go keeps getting better. Thanks for your hard work!