Dependency management of Go

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Recently wrote an online session copy tool using the Go language. The dependency management of Go engineering was very unsatisfactory. The reasons for dissatisfaction have the following points.

  1. Over-reliance on warehouses and even the URLs of warehouses as namespaces.

  2. The specified version or tag cannot be supported.

Based on the observation of the dependency management of go, the following points can be observed.

  1. The import section is scanned when the go get is executed

  2. Pull the dependency to the SRC directory below and proceed to the previous step

  3. When all dependencies are pulled, use the breadth-first search algorithm to search for the dependency graph and compile it directly.

Then the solution is very simple.

  1. Design a configuration file that specifies the branch or tag for each project

  2. Pull all items from the warehouse to the specified Brnach or tag

  3. Scan the import portion of all files to build a compiled dependency graph

  4. Breadth-first traversal of dependency graphs for compilation


Shortly after playing go, I don't know if there are any more advanced solutions or existing solutions to solve the branch problem in the Go project.



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.