From 9cc170f9a5b84d8cc3f477c68f6f2a2dc9196755 Mon Sep 17 00:00:00 2001 From: Burak Guven Date: Wed, 13 Sep 2017 19:54:40 -0700 Subject: [PATCH] math/rand: fix comment for Shuffle Shuffle panics if n < 0, not n <= 0. The comment for the (*Rand).Shuffle function is already accurate. Change-Id: I073049310bca9632e50e9ca3ff79eec402122793 Reviewed-on: https://go-review.googlesource.com/63750 Reviewed-by: Ian Lance Taylor --- src/math/rand/rand.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go index 85871725a6..8edb22e1da 100644 --- a/src/math/rand/rand.go +++ b/src/math/rand/rand.go @@ -346,7 +346,7 @@ func Float32() float32 { return globalRand.Float32() } func Perm(n int) []int { return globalRand.Perm(n) } // Shuffle pseudo-randomizes the order of elements using the default Source. -// n is the number of elements. Shuffle panics if n <= 0. +// n is the number of elements. Shuffle panics if n < 0. // swap swaps the elements with indexes i and j. func Shuffle(n int, swap func(i, j int)) { globalRand.Shuffle(n, swap) } -- 2.50.0