From: Russ Cox Date: Mon, 21 Nov 2022 22:34:16 +0000 (-0500) Subject: doc/go1.20: document math/rand autoseed and deprecation of Seed X-Git-Tag: go1.20rc1~112 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=86ede1727201c267497e984d623f6e859de8a3f2;p=gostls13.git doc/go1.20: document math/rand autoseed and deprecation of Seed Change-Id: Ie557f3841781ac47f4044a395106a2e5b13e9695 Reviewed-on: https://go-review.googlesource.com/c/go/+/452561 Run-TryBot: Russ Cox TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills --- diff --git a/doc/go1.20.html b/doc/go1.20.html index 211425e0dc..3d49dd2442 100644 --- a/doc/go1.20.html +++ b/doc/go1.20.html @@ -612,12 +612,17 @@ proxyHandler := &httputil.ReverseProxy{
math/rand
-

- TODO: https://go.dev/issue/54880: seed global generator randomly +

+ The math/rand package now automatically seeds + the global random number generator + (used by top-level functions like Float64 and Int) with a random value, + and the top-level Seed function has been deprecated. + Programs that need a reproducible sequence of random numbers + should prefer to allocate their own random source, using rand.New(rand.NewSource(seed)).

- -

- TODO: https://go.dev/cl/436955: math/rand: deprecate Read +

+ Programs that need the earlier consistent global seeding behavior can set + GODEBUG=randautoseed=0 in their environment.