From f9890c6ad9f380fd3cdb66a33843f522d4790e03 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 26 Jan 2025 21:01:35 -0800 Subject: [PATCH] rand: deprecate in favor of math/rand/v2 For golang/go#61716 Fixes golang/go#71373 Change-Id: I478f963fc6ecd7de540e288ffa5f4f6dd87219d7 Reviewed-on: https://go-review.googlesource.com/c/exp/+/644475 Reviewed-by: Ian Lance Taylor Commit-Queue: Ian Lance Taylor Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Damien Neil --- rand/rand.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rand/rand.go b/rand/rand.go index ee6161bc6..4da3b0d07 100644 --- a/rand/rand.go +++ b/rand/rand.go @@ -4,17 +4,11 @@ // Package rand implements pseudo-random number generators. // -// Random numbers are generated by a Source. Top-level functions, such as -// Float64 and Int, use a default shared Source that produces a deterministic -// sequence of values each time a program is run. Use the Seed function to -// initialize the default Source if different behavior is required for each run. -// The default Source, a LockedSource, is safe for concurrent use by multiple -// goroutines, but Sources created by NewSource are not. However, Sources are small -// and it is reasonable to have a separate Source for each goroutine, seeded -// differently, to avoid locking. -// // For random numbers suitable for security-sensitive work, see the crypto/rand // package. +// +// Deprecated: use the math/rand/v2 package instead. This package is +// scheduled to be tagged and deleted, per https://go.dev/issue/61716. package rand import "sync"