This is a creation in Article, where the information may have evolved or changed.
1 Go Command General format:
Go command [ARG]
Where the command is the operation commands, ARG is the parameter of the command
2 Common commands
Go commands are: Get, run, build, FMT, install, test, etc.
(1) Go get
The go get command is primarily used to dynamically get remote code packages
(2) Go run
The Go Run command is used to compile and run the program directly, it generates a temporary file (but not a standard executable file), directly on the command line print output program execution results, user-friendly debugging
(3) Go build
The Go Build command is used to test the compilation package to see if there is a compilation error, and if the main package is compiled, the executable file is generated
(4) Go FMT
Go FMT format source code, some IDE save the source code when the automatic execution of the command, such as SUBL, you can also manually execute it
(5) Go install
The Go Install command has two steps: The first step is to compile the imported package file, all the imported package files are compiled before the main program is compiled, and the second step is to put the compiled executable file into the bin directory (GOPATH/BIN),compilationtranslationafterof thePackagetextpiecesput to pkg mesh record under ( GOPATH/PKG)
(6) Go test
The Go Test command is used to run the test file, which automatically reads the file named: *_test.go in the source directory, generates and runs the test executable, and the test successfully displays information such as "PASS", "OK" and so on.