- implement a WriteTo function that writes to multiple writers.
1. Write the []byte slice to all writers.
2. The function should return (using n) the bytes written by each writer with index position corresponding to the index position of the writer. An empty slice ([]int{}) should be returned if there are no writers as argument to the function.
3. If one of the writers returned an error, that error should be returned in the index position corresponding to the index position of the writer.
4. If one of the writers could not write the entire buffer, the error
io.ErrShortWrite should be returned in the index position corresponding to
that writer's index position.
Get Free Quote!
400 Experts Online