forked from cerc-io/plugeth
cmd/clef: fix staticcheck warnings (#20314)
This commit is contained in:
parent
190fb8180a
commit
a3d263dd3a
@ -387,7 +387,7 @@ func initialize(c *cli.Context) error {
|
|||||||
if c.GlobalBool(stdiouiFlag.Name) {
|
if c.GlobalBool(stdiouiFlag.Name) {
|
||||||
logOutput = os.Stderr
|
logOutput = os.Stderr
|
||||||
// If using the stdioui, we can't do the 'confirm'-flow
|
// If using the stdioui, we can't do the 'confirm'-flow
|
||||||
fmt.Fprintf(logOutput, legalWarning)
|
fmt.Fprint(logOutput, legalWarning)
|
||||||
} else {
|
} else {
|
||||||
if !confirm(legalWarning) {
|
if !confirm(legalWarning) {
|
||||||
return fmt.Errorf("aborted by user")
|
return fmt.Errorf("aborted by user")
|
||||||
@ -579,7 +579,7 @@ func signer(c *cli.Context) error {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
abortChan := make(chan os.Signal)
|
abortChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(abortChan, os.Interrupt)
|
signal.Notify(abortChan, os.Interrupt)
|
||||||
|
|
||||||
sig := <-abortChan
|
sig := <-abortChan
|
||||||
@ -694,7 +694,7 @@ func checkFile(filename string) error {
|
|||||||
|
|
||||||
// confirm displays a text and asks for user confirmation
|
// confirm displays a text and asks for user confirmation
|
||||||
func confirm(text string) bool {
|
func confirm(text string) bool {
|
||||||
fmt.Printf(text)
|
fmt.Print(text)
|
||||||
fmt.Printf("\nEnter 'ok' to proceed:\n> ")
|
fmt.Printf("\nEnter 'ok' to proceed:\n> ")
|
||||||
|
|
||||||
text, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
text, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user