Enter the main package, perform import import operations, such as the need to import the FMT package, then enter the FMT package, determine the FMT packet dependency, and then import the dependency package;
Dependent packages are imported only once, and after the dependency package is imported, the initialization of the package constants and variables is performed, and then the INIT function in the dependent package is executed;
After the dependency packages in the main package are imported, execute the initialization of the main package constants and variables, then execute the INIT function in the main package, and then execute the main function
Finally, the main function returns to end the Go program execution
This article is from the "Linux related" blog, so be sure to keep this source http://diadia.blog.51cto.com/5440926/1747450
Go Program Execution order