From 1aefdb1e154678dc5c103c32e979f990c3c62a88 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Tue, 3 May 2016 00:29:23 -0700 Subject: [PATCH] Use the correctly typed `rand.Int*` variant --- nomad/eval_broker.go | 2 +- nomad/rpc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nomad/eval_broker.go b/nomad/eval_broker.go index 96060b6c3..d91ee8244 100644 --- a/nomad/eval_broker.go +++ b/nomad/eval_broker.go @@ -348,7 +348,7 @@ func (b *EvalBroker) scanForSchedulers(schedulers []string) (*structs.Evaluation default: // Multiple tasks. We pick a random task so that we fairly // distribute work. - offset := rand.Int63n(n) + offset := rand.Intn(n) return b.dequeueForSched(eligibleSched[offset]) } } diff --git a/nomad/rpc.go b/nomad/rpc.go index 3d2339215..26b94489b 100644 --- a/nomad/rpc.go +++ b/nomad/rpc.go @@ -232,7 +232,7 @@ func (s *Server) forwardRegion(region, method string, args interface{}, reply in } // Select a random addr - offset := rand.Int31n(len(servers)) + offset := rand.Intn(len(servers)) server := servers[offset] s.peerLock.RUnlock()