math/rand: Example should demonstrate (in comments) how to do proper seeding #25325
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
The example for math/rand reads:
"Try changing this number" isn't super helpful advice (change to what?) and I have to look up what to plug in every time. For example last time I needed a math/rand, I copied from the other example, but I created my own *rand.Source when I didn't need to, because that's what the other example does.
I have been using Go for 5 years now and if I have to look up how to do it, odds are that other people do too.
It would be good if we could provide a better value in the comment, for example:
The text was updated successfully, but these errors were encountered: