From 2a3a9356637333b57aeb927ce2f482eebbd389c4 Mon Sep 17 00:00:00 2001 From: Jungho Ahn Date: Fri, 18 Oct 2019 15:12:46 -0700 Subject: [PATCH] Fix PrintErrln and PrintErrf to behave like PrintErr PrintErrln() and PrintErrf() prints to OutOrStderr while PrintErr() prints to ErrOrStderr(). This PR fixes PrintErrln and PrintErrf to work like PrintErr. --- command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command.go b/command.go index 42e500de5..5238f1345 100644 --- a/command.go +++ b/command.go @@ -1150,12 +1150,12 @@ func (c *Command) PrintErr(i ...interface{}) { // PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrln(i ...interface{}) { - c.Print(fmt.Sprintln(i...)) + c.PrintErr(fmt.Sprintln(i...)) } // PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrf(format string, i ...interface{}) { - c.Print(fmt.Sprintf(format, i...)) + c.PrintErr(fmt.Sprintf(format, i...)) } // CommandPath returns the full path to this command.