Use the correctly typed `rand.Int*` variant

This commit is contained in:
Sean Chittenden 2016-05-03 00:29:23 -07:00
parent 3a1dc9a194
commit 1aefdb1e15
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
2 changed files with 2 additions and 2 deletions

View File

@ -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])
}
}

View File

@ -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()