This is a created article in which the information may have evolved or changed.
Go is a programming language that advocates software engineering concepts.
The go code must be placed in the Gopath directory, which should contain three subdirectories:
SRC: Used to organize and save go source files in the form of a code package. Should be divided into three categories: library source code files, command source files, test source files.
PKG: Used to store the ". A" archive of the installed code package (library source file) built by the Go Install command. Like the pkg feature in the Goroot directory, the difference is that the PKG directory in the working directory is designed to hold the archive file for user code.
Bin: After completing the installation through the Go Install command, save the executable file generated by the Go command source file.
The so-called command source files, which can be run independently, can be converted into executable files by the go build or go Install command. Library source file refers to a code package of common source files.
If the project is not in the Gopath directory, you can specify the Gopath directory at compile time as the directory where the project resides.