Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/clef: fix staticcheck warnings #20314

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func initialize(c *cli.Context) error {
if c.GlobalBool(stdiouiFlag.Name) {
logOutput = os.Stderr
// If using the stdioui, we can't do the 'confirm'-flow
fmt.Fprintf(logOutput, legalWarning)
fmt.Fprint(logOutput, legalWarning)
} else {
if !confirm(legalWarning) {
return fmt.Errorf("aborted by user")
Expand Down Expand Up @@ -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)

sig := <-abortChan
Expand Down Expand Up @@ -694,7 +694,7 @@ func checkFile(filename string) error {

// confirm displays a text and asks for user confirmation
func confirm(text string) bool {
fmt.Printf(text)
fmt.Print(text)
fmt.Printf("\nEnter 'ok' to proceed:\n> ")

text, err := bufio.NewReader(os.Stdin).ReadString('\n')
Expand Down