Go does not have the concept of engineering documents, it is through the directory structure to reflect the structural relationship of the project. Therefore, in the habit of VC of the kind of engineering documents, the organization of the case, just beginning to touch go a bit uncomfortable, suddenly did not understand the meaning of environmental variables Gopath.
When I first looked at go tutorials, when I learned to write code, I only set a directory in Gopath. The directory has src, bin, pkg three directories, different application code is placed in the SRC, it seems more messy. For example, Gopath is a GoPro directory, and SRC has decentralized code for various unrelated applications.
This is just learning code, it is conceivable that once a real project, the code must be more complex, such a form of organization is not conducive to maintaining the code.
Later, began to look at the Beego code, in the process to understand, in fact, Gopath can set up multiple directories, each directory is the root of each project, the project all the code is placed in the SRC in the root directory, so that the different application code can be separated. For example, there are two projects under GoPro, respectively, Beego and seagull, each project has a directory bin,pkg (seagull not compiled, so no), Src. Add the project catalog Gopro/beego,gopro/seagull to the environment variable Gopath.
Go language Learning-engineering organization and Gopath Setup