From 5975d902543a19e50e223c3ae3083f9d4bbcac88 Mon Sep 17 00:00:00 2001 From: Kanak Singhal Date: Wed, 4 Oct 2023 15:02:43 +0000 Subject: [PATCH] fix documentation of Command.SetOut method The statement "If newOut is nil, os.Stdout is used" was misleading as `Command.Print` prints to os.Stderr when `outWriter = nil` As the default is based on which one of `OutOrStdout` or `OutOrStderr` is used, i.e. there is no default. --- command.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/command.go b/command.go index 6866f7d0..b8ecff4d 100644 --- a/command.go +++ b/command.go @@ -273,7 +273,6 @@ func (c *Command) SetArgs(a []string) { } // SetOutput sets the destination for usage and error messages. -// If output is nil, os.Stderr is used. // Deprecated: Use SetOut and/or SetErr instead func (c *Command) SetOutput(output io.Writer) { c.outWriter = output @@ -281,19 +280,16 @@ func (c *Command) SetOutput(output io.Writer) { } // SetOut sets the destination for usage messages. -// If newOut is nil, os.Stdout is used. func (c *Command) SetOut(newOut io.Writer) { c.outWriter = newOut } // SetErr sets the destination for error messages. -// If newErr is nil, os.Stderr is used. func (c *Command) SetErr(newErr io.Writer) { c.errWriter = newErr } // SetIn sets the source for input data -// If newIn is nil, os.Stdin is used. func (c *Command) SetIn(newIn io.Reader) { c.inReader = newIn }