GetRandomDecision randomly returns true or false, but weighted to one or the other. For example if success is set to 2 and failure to 1, true is twice as likely to be returned.
(success int, failure int)
| 287 | // GetRandomDecision randomly returns true or false, but weighted to one or the other. |
| 288 | // For example if success is set to 2 and failure to 1, true is twice as likely to be returned. |
| 289 | func GetRandomDecision(success int, failure int) bool { |
| 290 | return rand.Intn(success+failure) > failure-1 |
| 291 | } |
| 292 | |
| 293 | // GetRandomNumber randomly returns an integer between 1 and the number specified. |
| 294 | func GetRandomNumber(min int, max int) int { |
no outgoing calls
no test coverage detected