This is a created article in which the information may have evolved or changed.
Go language-related commands:
Bulid command:
Compiling the file or code package, compiling the command source file generates executable code, and compiling the library file does not produce results.
-A flag: Force compilation of all involved code packages
- Run command:
- Run the command source file (compile and run first)
- Parameter can only have one command source file
- -N flag: Prints the commands that are required to run during compilation, but does not actually execute them.
- -P N Tag: Parallel compilation, n is number.
- -V flag: Lists the names of the code packages that were compiled.
- -a-v tag: Lists the names of all compiled code packages.
- -work tag: Displays the path of the temporary working directory created at compile time without deleting it.
- The-X tag: Prints the commands that are needed to run the compilation process, and actually executes them.
- Install Command:
- Compile and install the file, the executable file is placed in the $gobin directory, the code package will be installed in the PKG related directory.
- When you take a file as a parameter, only those files are compiled and installed.
- These code packages and their dependencies are installed when the code package path is a parameter.
- Get command:
- Download and install the code package from the remote code warehouse.
- -d flag: Download only, not install.
- -fix tag: Perform the fix before compiling the installation.
- -U flag: Updates the local code.