Use the correctly typed rand.Int* variant

This commit is contained in:
Sean Chittenden
2016-05-03 00:29:23 -07:00
parent 990a094bed
commit 07fa0c58d4
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()