@@ -59,8 +59,8 @@ func NewCommand(cmd string, options ...func(*Command)) *Command {
5959 Env : []string {},
6060 }
6161
62- c .StdoutWriter = NewMultiplexedWriter (& c .stdout , & c .combined )
63- c .StderrWriter = NewMultiplexedWriter (& c .stderr , & c .combined )
62+ c .StdoutWriter = io . MultiWriter (& c .stdout , & c .combined )
63+ c .StderrWriter = io . MultiWriter (& c .stderr , & c .combined )
6464
6565 for _ , o := range options {
6666 o (c )
@@ -78,23 +78,23 @@ func NewCommand(cmd string, options ...func(*Command)) *Command {
7878// c.Execute()
7979//
8080func WithStandardStreams (c * Command ) {
81- c .StdoutWriter = NewMultiplexedWriter (os .Stdout , & c .stdout , & c .combined )
82- c .StderrWriter = NewMultiplexedWriter (os .Stderr , & c .stdout , & c .combined )
81+ c .StdoutWriter = io . MultiWriter (os .Stdout , & c .stdout , & c .combined )
82+ c .StderrWriter = io . MultiWriter (os .Stderr , & c .stdout , & c .combined )
8383}
8484
8585// WithCustomStdout allows to add custom writers to stdout
8686func WithCustomStdout (writers ... io.Writer ) func (c * Command ) {
8787 return func (c * Command ) {
8888 writers = append (writers , & c .stdout , & c .combined )
89- c .StdoutWriter = NewMultiplexedWriter (writers ... )
89+ c .StdoutWriter = io . MultiWriter (writers ... )
9090 }
9191}
9292
9393// WithCustomStderr allows to add custom writers to stderr
9494func WithCustomStderr (writers ... io.Writer ) func (c * Command ) {
9595 return func (c * Command ) {
9696 writers = append (writers , & c .stderr , & c .combined )
97- c .StderrWriter = NewMultiplexedWriter (writers ... )
97+ c .StderrWriter = io . MultiWriter (writers ... )
9898 }
9999}
100100
0 commit comments