(promptOpts *prompt.Options, v *StringPtrValidation)
| 211 | } |
| 212 | |
| 213 | func StringPtrFromPrompt(promptOpts *prompt.Options, v *StringPtrValidation) (*string, error) { |
| 214 | if v.Default != nil && promptOpts.DefaultStr == "" { |
| 215 | promptOpts.DefaultStr = *v.Default |
| 216 | } |
| 217 | valStr := prompt.Prompt(promptOpts) |
| 218 | if valStr == "" { // Treat empty prompt value as missing |
| 219 | return ValidateStringPtrMissing(v) |
| 220 | } |
| 221 | return StringPtrFromStr(valStr, v) |
| 222 | } |
| 223 | |
| 224 | func ValidateStringPtrMissing(v *StringPtrValidation) (*string, error) { |
| 225 | if v.Required { |
no test coverage detected