File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,19 @@ import (
66)
77
88// NewMultiplexedWriter returns a new multiplexer
9- func NewMultiplexedWriter (outputs ... io.Writer ) * MultiplexedWriter {
10- return & MultiplexedWriter {Outputs : outputs }
9+ func NewMultiplexedWriter (writers ... io.Writer ) * MultiplexedWriter {
10+ return & MultiplexedWriter {Writers : writers }
1111}
1212
1313// MultiplexedWriter writes to multiple writers at once
1414type MultiplexedWriter struct {
15- Outputs []io.Writer
15+ Writers []io.Writer
1616}
1717
1818// Write writes the given bytes. If one write fails it returns the error
1919// and bytes of the failed write operation
2020func (w MultiplexedWriter ) Write (p []byte ) (n int , err error ) {
21- for _ , o := range w .Outputs {
21+ for _ , o := range w .Writers {
2222 n , err = o .Write (p )
2323 if err != nil {
2424 return 0 , fmt .Errorf ("Error in writer: %s" , err .Error ())
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
1111func TestMultiplexedWriter (t * testing.T ) {
1212 writer01 := bytes.Buffer {}
1313 writer02 := bytes.Buffer {}
14- // Test another io.Writer interface type
14+ // Test another io.Writers interface type
1515 r , w , _ := os .Pipe ()
1616
1717 writer := NewMultiplexedWriter (& writer01 , & writer02 , w )
You can’t perform that action at this time.
0 commit comments