Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrShortWrite = errors.New("short write")
)
Functions ¶
func MultiWriteCloser ¶
func MultiWriteCloser(wc ...io.WriteCloser) io.WriteCloser
MultiWriteCloser creates a WriteCloser that duplicates its writes to all the provided writers, similar to the Unix tee(1) command.
Similarly, it extends the support for io.Closer, by implementing a multiWriteCloser which can commit to the same Close call across all writers
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. This does not happen with the Close() call, which is intended to be sent to all writers regardless of errors retrieved. It will return a single error encapsulating all errors if existing
Types ¶
This section is empty.