Telling a UNIX System What to Do
This chapter is about systems programming in Go. Systems programming involves working with files and directories, process control, signal handling, network programming, system files, configuration files, and file input and output (I/O). If you recall from Chapter 1, A Quick Introduction to Go, the reason for writing system utilities with Linux in mind is that, often, Go software is executed in a Docker environment—Docker images use the Linux operating system, which means that you might need to develop your utilities with the Linux operating system in mind. However, as Go code is portable, most system utilities work on Windows machines without any changes or with minor modifications. The key idea to remember is that Go makes systems programming more portable. Additionally, in this chapter, we are going to improve the statistics application with the help of the cobra
package.
As already mentioned, starting with Go 1.16, the GO111MODULE...