March 2020
Intermediate to advanced
406 pages
8h 39m
English
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. ...
Read now
Unlock full access