1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

chasquid-util: Print errors to stderr

To make it more difficult to accidentally supress errors, or mistake them
for legitimate output, print errors to stderr.
This commit is contained in:
Alberto Bertogli
2024-03-04 19:29:24 +00:00
parent 8e1fd52442
commit b0877f0866
2 changed files with 7 additions and 6 deletions

View File

@@ -96,9 +96,10 @@ func main() {
}
}
// Fatalf prints the given message, then exits the program with an error code.
// Fatalf prints the given message to stderr, then exits the program with an
// error code.
func Fatalf(s string, arg ...interface{}) {
fmt.Printf(s+"\n", arg...)
fmt.Fprintf(os.Stderr, s+"\n", arg...)
os.Exit(1)
}