Go does not care about the name of the source file of an autonomous program as long as the package name is main and there is a main() function in it. This is because the main() function is where the program execution begins. This also means that you cannot have multiple main() functions in the files of a single project.
There exist two ways to run a Go program:
- The first one, go run, just executes the Go code without generating any new files, only some temporary ones that are deleted afterward
- The second way, go build, compiles the code, generates an executable file, and waits for you to run the executable file
This book is written on an Apple Mac OS Sierra system using the Homebrew (https://brew.sh/) version of Go. However, you should have no difficulties compiling and running the presented Go code on most Linux and FreeBSD systems, provided that you have...