diff --git a/consul/structs/structs.go b/consul/structs/structs.go index 3e7ef5955e..d582560cd8 100644 --- a/consul/structs/structs.go +++ b/consul/structs/structs.go @@ -410,7 +410,7 @@ type CheckServiceNodes []CheckServiceNode // Shuffle does an in-place random shuffle using the Fisher-Yates algorithm. func (nodes CheckServiceNodes) Shuffle() { for i := len(nodes) - 1; i > 0; i-- { - j := rand.Int31() % int32(i+1) + j := rand.Int31n(int32(i + 1)) nodes[i], nodes[j] = nodes[j], nodes[i] } }