April 2024
Intermediate to advanced
278 pages
5h 17m
English
Your program communicates with the world using input and output (I/O for short). Go provides a great abstraction over I/O with the io.Reader and io.Writer interfaces. These interfaces are implemented by files, sockets, HTTP response bodies, and more.
While io.Reader and io.Writer give a standard API to I/O, there are many implementation-specific details you need to consider when working with I/O. In this chapter we’ll look at in-memory I/O, compression, and memory mapped files for faster searching. We’ll also see how you can implement these interfaces in your types and why you should do so.
Since files are a big part of I/O, we’ll look at file paths (for example, /var/log/httpd.log) and how to manipulate ...
Read now
Unlock full access