(out io.Writer, initialPrompt string)
| 111 | var errPasswordsDoNotMatch = errors.New("passwords do not match") |
| 112 | |
| 113 | func askConfirmPass(out io.Writer, initialPrompt string) (string, error) { |
| 114 | pwd, err := askPass(out, initialPrompt) |
| 115 | if err != nil { |
| 116 | return "", errors.Wrap(err, "error asking for password") |
| 117 | } |
| 118 | |
| 119 | pwd2, err := askPass(out, "Re-enter password for verification: ") |
| 120 | if err != nil { |
| 121 | return "", errors.Wrap(err, "error asking for password") |
| 122 | } |
| 123 | |
| 124 | if pwd != pwd2 { |
| 125 | return "", errPasswordsDoNotMatch |
| 126 | } |
| 127 | |
| 128 | return pwd, nil |
| 129 | } |
no test coverage detected