selectRandomCombinations selects up to n random combinations from a list of combinations.
(combinations []string, n int)
| 1668 | |
| 1669 | // selectRandomCombinations selects up to n random combinations from a list of combinations. |
| 1670 | func selectRandomCombinations(combinations []string, n int) []string { |
| 1671 | if len(combinations) <= n { |
| 1672 | return combinations |
| 1673 | } |
| 1674 | |
| 1675 | rand.Shuffle(len(combinations), func(i, j int) { |
| 1676 | combinations[i], combinations[j] = combinations[j], combinations[i] |
| 1677 | }) |
| 1678 | |
| 1679 | return combinations[:n] |
| 1680 | } |
| 1681 | |
| 1682 | // requestDefault makes HTTP request to check the default response |
| 1683 | func requestDefault(options RequestOptions) { |
no outgoing calls
no test coverage detected