Closed InPermutation closed 7 months ago
https://gobyexample.com/random-numbers says,
The default number generator is deterministic, so it’ll produce the same sequence of numbers each time by default. To produce varying sequences, give it a seed that changes.
However, the current docs for rand.Seed say,
rand.Seed
func Seed DEPRECATED … If Seed is not called, the generator is seeded randomly at program startup. Prior to Go 1.20, the generator was seeded like Seed(1) at program startup.
func Seed DEPRECATED … If Seed is not called, the generator is seeded randomly at program startup.
func
Seed
Prior to Go 1.20, the generator was seeded like Seed(1) at program startup.
So, it's no longer true that the default number generator is deterministic.
I'm not sure how to best update the verbiage, so I opened this issue for discussion.
Thanks for the report; this is now fixed.
Separately, #507 will track the update to math/rand/v2 once Go 1.22 is out
math/rand/v2
https://gobyexample.com/random-numbers says,
However, the current docs for
rand.Seed
say,So, it's no longer true that the default number generator is deterministic.
I'm not sure how to best update the verbiage, so I opened this issue for discussion.