mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
console/prompt: return err if err != nil
This commit is contained in:
parent
efe58eac00
commit
2248ac1e28
1 changed files with 4 additions and 1 deletions
|
|
@ -143,10 +143,13 @@ func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err err
|
||||||
// choice to be made, returning that choice.
|
// choice to be made, returning that choice.
|
||||||
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
|
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
|
||||||
input, err := p.PromptInput(prompt + " [y/n] ")
|
input, err := p.PromptInput(prompt + " [y/n] ")
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
|
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return false, err
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetHistory sets the input scrollback history that the prompter will allow
|
// SetHistory sets the input scrollback history that the prompter will allow
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue