Fix tty.Open() position
parent
a0232ea6ef
commit
d6ee0499f5
|
@ -66,12 +66,6 @@ var (
|
|||
)
|
||||
|
||||
func prompt() (string, string, error) {
|
||||
t, err := tty.Open()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
defer t.Close()
|
||||
|
||||
fmt.Print("E-Mail: ")
|
||||
email, err := readUsername()
|
||||
if err != nil {
|
||||
|
@ -81,6 +75,11 @@ func prompt() (string, string, error) {
|
|||
fmt.Print("Password: ")
|
||||
var password string
|
||||
if readPassword == nil {
|
||||
t, err := tty.Open()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
defer t.Close()
|
||||
password, err = t.ReadPassword()
|
||||
} else {
|
||||
password, err = readPassword()
|
||||
|
|
Loading…
Reference in New Issue