(promptOpts *prompt.Options, v *StringValidation)
| 193 | } |
| 194 | |
| 195 | func StringFromPrompt(promptOpts *prompt.Options, v *StringValidation) (string, error) { |
| 196 | promptOpts.DefaultStr = v.Default |
| 197 | valStr := prompt.Prompt(promptOpts) |
| 198 | if valStr == "" { // Treat empty prompt value as missing |
| 199 | return ValidateStringMissing(v) |
| 200 | } |
| 201 | return StringFromStr(valStr, v) |
| 202 | } |
| 203 | |
| 204 | func ValidateStringMissing(v *StringValidation) (string, error) { |
| 205 | if v.Required { |
no test coverage detected