]> Cypherpunks repositories - gostls13.git/commitdiff
math/rand: document that Source returned by NewSource implements Source64
authorJonathan FOng <jonathanfong098@gmail.com>
Fri, 26 Aug 2022 19:10:32 +0000 (12:10 -0700)
committerJoseph Tsai <joetsai@digital-static.net>
Fri, 2 Sep 2022 05:05:13 +0000 (05:05 +0000)
Fixes #44488

Change-Id: I570950799788678b9dc6e9ddad894973b4611e09
Reviewed-on: https://go-review.googlesource.com/c/go/+/425974
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/math/rand/rand.go

index 4cce3dab640a335bde736a794f138701e0b5e740..bcf2f9c950526e48bf42bb2566161d90bccb1cb5 100644 (file)
@@ -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