cmd/puppeth: remove wrapping loop in single reads
This commit is contained in:
parent
0cc9b8791e
commit
455fcc8309
@ -106,7 +106,6 @@ func (w *wizard) readString() string {
|
||||
// readDefaultString reads a single line from stdin, trimming if from spaces. If
|
||||
// an empty line is entered, the default value is returned.
|
||||
func (w *wizard) readDefaultString(def string) string {
|
||||
for {
|
||||
fmt.Printf("> ")
|
||||
text, err := w.in.ReadString('\n')
|
||||
if err != nil {
|
||||
@ -117,7 +116,6 @@ func (w *wizard) readDefaultString(def string) string {
|
||||
}
|
||||
return def
|
||||
}
|
||||
}
|
||||
|
||||
// readInt reads a single line from stdin, trimming if from spaces, enforcing it
|
||||
// to parse into an integer.
|
||||
@ -207,7 +205,6 @@ func (w *wizard) readDefaultFloat(def float64) float64 {
|
||||
// readPassword reads a single line from stdin, trimming it from the trailing new
|
||||
// line and returns it. The input will not be echoed.
|
||||
func (w *wizard) readPassword() string {
|
||||
for {
|
||||
fmt.Printf("> ")
|
||||
text, err := terminal.ReadPassword(int(syscall.Stdin))
|
||||
if err != nil {
|
||||
@ -216,7 +213,6 @@ func (w *wizard) readPassword() string {
|
||||
fmt.Println()
|
||||
return string(text)
|
||||
}
|
||||
}
|
||||
|
||||
// readAddress reads a single line from stdin, trimming if from spaces and converts
|
||||
// it to an Ethereum address.
|
||||
|
Loading…
Reference in New Issue
Block a user