In this chapter, we looked at an overview of how to execute file operations in Go. In order to locate files, an extensive array of functions are offered by the filepath package. These can help you execute all kind of operations, from composing paths to extracting elements from it.
We also looked at how to read an operation using various methods, from the easiest and less memory efficient ones that are located in the io/ioutil package to the ones that require an io.Writer implementation to read a fixed chunk of bytes. The importance of the ability to peek content, as implemented in the bufio package, allows for a whole set of operations like read word or read line, which stop the reading operation when a token is found. There are other interfaces that are satisfied by files that are very useful; for example, io.Closer ensures that the resource is...