mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-22 07:49:26 +00:00
Merge pull request #2371 from hiddentao/fix_prompt_passwd_input
Strip extraneous carriage return from end of entered password
This commit is contained in:
commit
9866f19d6a
1 changed files with 1 additions and 0 deletions
|
|
@ -92,6 +92,7 @@ func PromptPassword(prompt string, warnTerm bool) (string, error) {
|
||||||
}
|
}
|
||||||
fmt.Print(prompt)
|
fmt.Print(prompt)
|
||||||
input, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
input, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||||
|
input = strings.TrimRight(input, "\r\n")
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
return input, err
|
return input, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue