Fix test again

This commit is contained in:
Till Faelligen 2022-03-18 19:12:02 +01:00
parent 6ff9b7ddce
commit 0b2bc83d82

View file

@ -157,6 +157,7 @@ func getPassword(password, pwdFile string, pwdStdin bool, r io.Reader) (string,
}
// If no parameter was set, ask the user to provide the password
if password == "" {
fmt.Print("Enter Password: ")
bytePassword, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
@ -173,5 +174,7 @@ func getPassword(password, pwdFile string, pwdStdin bool, r io.Reader) (string,
return "", fmt.Errorf("Entered passwords don't match")
}
return strings.TrimSpace(string(bytePassword)), nil
}
return password, nil
}