type eofReader … func (eofReader) Read([]byte) (int, error) { … } type multiReader … func (mr *multiReader) Read(p []byte) (n int, err error) { … } func (mr *multiReader) WriteTo(w Writer) (sum int64, err error) { … } func (mr *multiReader) writeToWithBuffer(w Writer, buf []byte) (sum int64, err error) { … } var _ … // MultiReader returns a Reader that's the logical concatenation of // the provided input readers. They're read sequentially. Once all // inputs have returned EOF, Read will return EOF. If any of the readers // return a non-nil, non-EOF error, Read will return that error. func MultiReader(readers ...Reader) Reader { … } type multiWriter … func (t *multiWriter) Write(p []byte) (n int, err error) { … } var _ … func (t *multiWriter) WriteString(s string) (n int, err error) { … } // MultiWriter creates a writer that duplicates its writes to all the // provided writers, similar to the Unix tee(1) command. // // Each write is written to each listed writer, one at a time. // If a listed writer returns an error, that overall write operation // stops and returns the error; it does not continue down the list. func MultiWriter(writers ...Writer) Writer { … }