From df17f4df4588e6ff41b0ff3045382775d6a8f748 Mon Sep 17 00:00:00 2001 From: Fredrik Wallgren Date: Wed, 11 Nov 2015 10:29:01 +0100 Subject: [PATCH] Fix bug with error not being written to stderr Only the usage message was written to stderr, the error was written with the standard fmt.Println. --- usage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage.go b/usage.go index 13134d0..a80c817 100644 --- a/usage.go +++ b/usage.go @@ -12,7 +12,7 @@ import ( // Fail prints usage information to stderr and exits with non-zero status func (p *Parser) Fail(msg string) { p.WriteUsage(os.Stderr) - fmt.Println("error:", msg) + fmt.Fprintln(os.Stderr, "error:", msg) os.Exit(-1) }