(f *Faker, i []int)
| 279 | func (f *Faker) RandomInt(i []int) int { return randomInt(f, i) } |
| 280 | |
| 281 | func randomInt(f *Faker, i []int) int { |
| 282 | size := len(i) |
| 283 | if size == 0 { |
| 284 | return 0 |
| 285 | } |
| 286 | if size == 1 { |
| 287 | return i[0] |
| 288 | } |
| 289 | return i[f.IntN(size)] |
| 290 | } |
| 291 | |
| 292 | // RandomUint will take in a slice of uint and return a randomly selected value |
| 293 | func RandomUint(u []uint) uint { return randomUint(GlobalFaker, u) } |
no test coverage detected
searching dependent graphs…