Expose OutOrStdout and OutOrStderr and don't make assumptions if output is not set

This commit is contained in:
Fabiano Franz
2016-07-15 17:12:07 -03:00
parent a272c3cbd5
commit 20217d8f5e
2 changed files with 10 additions and 10 deletions

View File

@ -646,7 +646,7 @@ func TestSubcommandArgEvaluation(t *testing.T) {
second := &Command{
Use: "second",
Run: func(cmd *Command, args []string) {
fmt.Fprintf(cmd.getOutOrStdout(), "%v", args)
fmt.Fprintf(cmd.OutOrStdout(), "%v", args)
},
}
first.AddCommand(second)