1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-30 19:22:11 +00:00

refactor: avoid unnecessary usage of Printf

This commit is contained in:
Julien Voisin 2025-09-08 20:54:16 +02:00 committed by GitHub
parent d70817e441
commit 84078c7c20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 7 deletions

View file

@ -5,6 +5,7 @@ package cli // import "miniflux.app/v2/internal/cli"
import (
"bufio"
"errors"
"fmt"
"os"
"strings"
@ -16,7 +17,7 @@ func askCredentials() (string, string) {
fd := int(os.Stdin.Fd())
if !term.IsTerminal(fd) {
printErrorAndExit(fmt.Errorf("this is not an interactive terminal, exiting"))
printErrorAndExit(errors.New("this is not an interactive terminal, exiting"))
}
fmt.Print("Enter Username: ")
@ -30,6 +31,6 @@ func askCredentials() (string, string) {
defer term.Restore(fd, state)
bytePassword, _ := term.ReadPassword(fd)
fmt.Printf("\n")
fmt.Print("\n")
return strings.TrimSpace(username), strings.TrimSpace(string(bytePassword))
}

View file

@ -263,6 +263,6 @@ func Parse() {
}
func printErrorAndExit(err error) {
fmt.Fprintf(os.Stderr, "%v\n", err)
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}