aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorhopehook <hopehook.com@gmail.com>2022-09-30 09:17:11 +0800
committerGopher Robot <gobot@golang.org>2022-10-27 04:32:55 +0000
commit599a1e40c6dc4d02e2d0ae5a22659b49dc327e40 (patch)
treea54ad1de8a582672c8652493158bc231361408e1 /src/math
parent612bb34af5299a33b0b5bdebc92a775153d72ebb (diff)
downloadgo-599a1e40c6dc4d02e2d0ae5a22659b49dc327e40.tar.xz
math/rand: deprecate Read
For #20661. Change-Id: I1e638cb619e643eadc210d71f92bd1af7bafc912 Reviewed-on: https://go-review.googlesource.com/c/go/+/436955 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: hopehook <hopehook@golangcn.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/math')
-rw-r--r--src/math/rand/rand.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go
index 2d45a28280..f6b015aba2 100644
--- a/src/math/rand/rand.go
+++ b/src/math/rand/rand.go
@@ -377,6 +377,8 @@ func Shuffle(n int, swap func(i, j int)) { globalRand.Shuffle(n, swap) }
// Read generates len(p) random bytes from the default Source and
// writes them into p. It always returns len(p) and a nil error.
// Read, unlike the Rand.Read method, is safe for concurrent use.
+//
+// Deprecated: For almost all use cases, crypto/rand.Read is more appropriate.
func Read(p []byte) (n int, err error) { return globalRand.Read(p) }
// NormFloat64 returns a normally distributed float64 in the range