GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`
(retry int)
| 1279 | // formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random |
| 1280 | // integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3` |
| 1281 | func GetRandomName(retry int) string { |
| 1282 | begin: |
| 1283 | //nolint:gosec // cryptographic precision not required for randomly selecting from set |
| 1284 | name := fmt.Sprintf("%s_%s", left[rand.Intn(len(left))], right[rand.Intn(len(right))]) |
| 1285 | if name == "boring_wozniak" /* Steve Wozniak is not boring */ { |
| 1286 | goto begin |
| 1287 | } |
| 1288 | |
| 1289 | if retry > 0 { |
| 1290 | //nolint:gosec // cryptographic precision not required for randomly selecting from fixed range |
| 1291 | name = fmt.Sprintf("%s%d", name, rand.Intn(10)) |
| 1292 | } |
| 1293 | return name |
| 1294 | } |
no outgoing calls
no test coverage detected