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.
Over-reliance on warehouses and even the URLs of warehouses as namespaces.
The specified version or tag cannot be supported.
Based on the observation of the dependency management of go, the following points can be observed.
The import section is scanned when the go get is executed
Pull the dependency to the SRC directory below and proceed to the previous step
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.
Design a configuration file that specifies the branch or tag for each project
Pull all items from the warehouse to the specified Brnach or tag
Scan the import portion of all files to build a compiled dependency graph
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.