About file input and output
File input and output includes everything that has to do with reading the data of a file and writing the desired data to a file. There is not a single operating system that does not offer support for files and therefore for file input and output.
As this chapter is pretty big, I will stop talking and start showing you practical Go code that will make things clearer. So, the first thing that you will learn in this chapter is byte slices, which are very important in applications that are concerned with file input and output.
Byte slices
Byte slices are a kind of slices used for file reading and writing. Putting it simply, they are slices of bytes used as a buffer during file reading and writing operations. This section will present a small Go example where a byte slice is used for writing to a file and reading from a file. As you will see byte slices all over this chapter, make sure that you understand the presented example. The related Go code is saved as byteSlice...