Go language Learning-engineering organization and Gopath Setup

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.