SpecificValueValidation is a validation function that checks if the value is in the list of options
(values ...string)
| 61 | |
| 62 | // SpecificValueValidation is a validation function that checks if the value is in the list of options |
| 63 | func SpecificValueValidation(values ...string) func(string) error { |
| 64 | return func(checkValue string) error { |
| 65 | for _, allowedValue := range values { |
| 66 | if checkValue == allowedValue { |
| 67 | return nil |
| 68 | } |
| 69 | } |
| 70 | return fmt.Errorf("Please choose one of %s", strings.Join(values, "/")) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // ValidateAKID checks if the input is a valid AWS Access Key ID |
| 75 | func ValidateAKID(input string) error { |