How to Use io.TeeReader and io.MultiReader

Use io.MultiReader to chain readers sequentially and io.TeeReader to duplicate a stream to a secondary writer.

Use io.MultiReader to read from multiple sources sequentially and io.TeeReader to copy data to a secondary destination while reading.

import "io"

// Read from r1, then r2, then r3 sequentially
combined := io.MultiReader(r1, r2, r3)

// Read from r and simultaneously copy every byte to w
reader := io.TeeReader(r, w)