Compile and run golang of two ways:
go build -> generate a binary executable files (.exe file is the win), and then performing
go run ---> internal compile a binary file, direct execution.
The actual development will use go build, generate and execute binary runtime environment file will also go into the pack, can also be performed in the operating environment of the platform does not go, but need to go run in the operating environment have a go situation, we can compiler implementation.
The implementation of the executable file name.
go build -o myhello.go hello.go // will hello.go modified to myhello.go, generate a binary executable file named myhello of.
golang in any package, you can go have a unique file with the main method, if there are multiple cases will error.
review:
What (a) sdk go language is?
(B) GoLang environment variable configuration and its role
Write (c) GoLang program, compiling, running steps
Rules written (four) GoLang program