There are a number of other functions in the io and io/ioutil packages that help with managing readers, writers, and more. Knowing all the tools available will help you to avoid writing unnecessary code, and will guide you in using the best tool for the job.
Built-in utilities
Copying from one stream to another
There are three main functions in the io package that make it possible to transfer data from a writer to a reader. This is a very common scenario; you could be writing the contents from a file opened for reading to another file opened for writing, for instance, or draining a buffer and writing its content as standard output.
We already saw how to use the io.Copy function on a file to simulate the...