go run runs and compiles a named Go program. The invocation stanza for go run is go run [build flags] [-exec xprog] package [arguments...].
Go run allows a developer to quickly compile and run a go binary in one operation. During this process, go run builds the executable file, runs it, and then deletes the executable file. This is particularly helpful in a development environment. As you rapidly iterate on your Go program, go run can be used as a shortcut to validate that the code you are changing will result in a build artifact that you deem acceptable for use. As we learned earlier in this chapter, the build flags for many of these tools are consistent.
goRun.go is one of the simplest possible go programs. It has no arguments, just an empty main() function invocation. We are using this as an example to show this process with no additional...