]> Cypherpunks.ru repositories - gostls13.git/commit
math/rand: deprecate Seed
authorRuss Cox <rsc@golang.org>
Wed, 16 Nov 2022 17:04:32 +0000 (12:04 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 16 Nov 2022 21:21:22 +0000 (21:21 +0000)
commitad7dc8ad55e6540bbf285df869d4ee6c12fff0e7
tree78c47e872c2b6c7c269b7f6a5015fd7844b0fd66
parente6eaf39cfaf253ebaff7fff3737f0f1d91024345
math/rand: deprecate Seed

Programs that call Seed and then expect a specific sequence
of results from the global random source (using functions such as Int)
can be broken when a dependency changes how much it consumes
from the global random source. To avoid such breakages, programs
that need a specific result sequence should use NewRand(NewSource(seed))
to obtain a random generator that other packages cannot access.

Fixes #56319.

Change-Id: Idac33991b719d2c71f109f51dacb3467a649e01e
Reviewed-on: https://go-review.googlesource.com/c/go/+/451375
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
src/math/rand/rand.go