randInt generates a random integer in the range [0, limit).
(limit int)
| 44 | |
| 45 | // randInt generates a random integer in the range [0, limit). |
| 46 | func randInt(limit int) int { |
| 47 | if limit <= 0 { |
| 48 | return 0 |
| 49 | } |
| 50 | n, err := cryptorand.Int63n(int64(limit)) |
| 51 | if err != nil { |
| 52 | return 0 |
| 53 | } |
| 54 | return int(n) |
| 55 | } |
| 56 | |
| 57 | // UpdateGoldenFiles indicates golden files should be updated. |
| 58 | // To update the golden files: |
no test coverage detected