There is another way to execute your Go code that does not create any permanent executable files – it just generates some intermediate files that are automatically deleted afterward.
So, in order to run aSourceFile.go without creating an executable file, you will need to execute the following command:
$ go run aSourceFile.go This is a sample Go program!
As you can see, the output of the preceding command is exactly the same as before.
This book mainly uses go run to execute the example code; primarily because it is simpler than running go build and then executing the executable file. Additionally, go run does not leave any files on your hard disk after the program has finished its execution.