From 8e35910640bd190103d99d994d54b738e619c858 Mon Sep 17 00:00:00 2001 From: Jonathan FOng Date: Fri, 26 Aug 2022 12:10:32 -0700 Subject: [PATCH] math/rand: document that Source returned by NewSource implements Source64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #44488 Change-Id: I570950799788678b9dc6e9ddad894973b4611e09 Reviewed-on: https://go-review.googlesource.com/c/go/+/425974 Reviewed-by: Daniel Martí Reviewed-by: Joseph Tsai TryBot-Result: Gopher Robot Run-TryBot: Joseph Tsai Reviewed-by: Heschi Kreinick Reviewed-by: David Chase --- src/math/rand/rand.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go index 4cce3dab64..bcf2f9c950 100644 --- a/src/math/rand/rand.go +++ b/src/math/rand/rand.go @@ -40,7 +40,12 @@ type Source64 interface { // NewSource returns a new pseudo-random Source seeded with the given value. // Unlike the default Source used by top-level functions, this source is not // safe for concurrent use by multiple goroutines. +// The returned Source implements Source64. func NewSource(seed int64) Source { + return newSource64(seed) +} + +func newSource64(seed int64) Source64 { var rng rngSource rng.Seed(seed) return &rng