(set string)
| 53 | } |
| 54 | |
| 55 | func adminUserRandChar(set string) (byte, error) { |
| 56 | if len(set) == 0 { |
| 57 | return 0, fmt.Errorf("empty character set") |
| 58 | } |
| 59 | idx, err := adminUserRandInt(len(set)) |
| 60 | if err != nil { |
| 61 | return 0, err |
| 62 | } |
| 63 | return set[idx], nil |
| 64 | } |
| 65 | |
| 66 | func adminUserRandInt(maxVal int) (int, error) { |
| 67 | if maxVal <= 0 { |
no test coverage detected