golang source file

Go source file is divided into three kinds:

1) Source file command: If the source file is declared a main part of the code packets and the document code includes no parameters main function declaration statements and results, then it is the command source files. Source files can be up and running commands directly go run command. All source code files in the same code package, which belongs to the code name of the package must be consistent. If the command source files and library source code files in the same package, then go build can not be performed correctly and go install command in the package. In other words, these source files can not be compiled and installed by conventional methods. Thus, the command source files are usually placed in a separate code package. As the entry program module. Also not recommended there are multiple files in the same command source code package. Also there will go build and go install command can not compile and install the code package.

2) Treasury source file

3) Test source files

Guess you like

Origin www.cnblogs.com/saryli/p/11607292.html