@@ -59,8 +59,8 @@ func NewCommand(cmd string, options ...func(*Command)) *Command {
59
59
Env : []string {},
60
60
}
61
61
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 )
64
64
65
65
for _ , o := range options {
66
66
o (c )
@@ -78,23 +78,23 @@ func NewCommand(cmd string, options ...func(*Command)) *Command {
78
78
// c.Execute()
79
79
//
80
80
func 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 )
83
83
}
84
84
85
85
// WithCustomStdout allows to add custom writers to stdout
86
86
func WithCustomStdout (writers ... io.Writer ) func (c * Command ) {
87
87
return func (c * Command ) {
88
88
writers = append (writers , & c .stdout , & c .combined )
89
- c .StdoutWriter = NewMultiplexedWriter (writers ... )
89
+ c .StdoutWriter = io . MultiWriter (writers ... )
90
90
}
91
91
}
92
92
93
93
// WithCustomStderr allows to add custom writers to stderr
94
94
func WithCustomStderr (writers ... io.Writer ) func (c * Command ) {
95
95
return func (c * Command ) {
96
96
writers = append (writers , & c .stderr , & c .combined )
97
- c .StderrWriter = NewMultiplexedWriter (writers ... )
97
+ c .StderrWriter = io . MultiWriter (writers ... )
98
98
}
99
99
}
100
100
0 commit comments