diff --git a/command.go b/command.go index fdac9d27..a881fec2 100644 --- a/command.go +++ b/command.go @@ -218,13 +218,6 @@ func (c *Command) SetArgs(a []string) { c.args = a } -// 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 - c.errWriter = output -} // SetOut sets the destination for usage messages. // If newOut is nil, os.Stdout is used. diff --git a/command_test.go b/command_test.go index 8ec52f44..f8c2ae30 100644 --- a/command_test.go +++ b/command_test.go @@ -1557,14 +1557,6 @@ func TestEnableCommandSortingIsDisabled(t *testing.T) { EnableCommandSorting = true } -func TestSetOutput(t *testing.T) { - c := &Command{} - c.SetOutput(nil) - if out := c.OutOrStdout(); out != os.Stdout { - t.Errorf("Expected setting output to nil to revert back to stdout") - } -} - func TestSetOut(t *testing.T) { c := &Command{} c.SetOut(nil) @@ -1814,7 +1806,8 @@ func (tc *calledAsTestcase) test(t *testing.T) { parent.SetArgs(tc.args) output := new(bytes.Buffer) - parent.SetOutput(output) + parent.SetOut(output) + parent.SetErr(output) parent.Execute()