diff options
| author | Ian Lance Taylor <iant@golang.org> | 2023-04-03 18:41:54 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@google.com> | 2023-04-04 20:18:09 +0000 |
| commit | 6d2cac12dbbd0e2f349106f1e4990b2feb0dda40 (patch) | |
| tree | 22b0cdc724825f9860661ab77f27f688d3bb0fb8 /src | |
| parent | d0099eff5e2e8dedd94eb1821408212c10231a47 (diff) | |
| download | go-6d2cac12dbbd0e2f349106f1e4990b2feb0dda40.tar.xz | |
math/rand: clarify Seed deprecation note
Fixes #59331
Change-Id: I62156be2f2758c59349c3b02db6cf9140429c9e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/481915
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/math/rand/rand.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go index a98b3905bd..cc1f95c88d 100644 --- a/src/math/rand/rand.go +++ b/src/math/rand/rand.go @@ -387,12 +387,10 @@ func (fs *fastSource) read(p []byte, readVal *int64, readPos *int8) (n int, err // Alternately, set GODEBUG=randautoseed=0 in the environment // before making any calls to functions in this package. // -// Deprecated: 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 New(NewSource(seed)) -// to obtain a random generator that other packages cannot access. +// Deprecated: As of Go 1.20 there is no reason to call Seed with +// a random value. Programs that call Seed with a known value to get +// a specific sequence of results should use New(NewSource(seed)) to +// obtain a local random generator. func Seed(seed int64) { orig := globalRandGenerator.Load() |
