Golang Project Git-subtree Perfect solution to differential package management

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

Goal:

1. The Golang official has moved the URL of the package following its own project Git code uploaded to the project source.

2. Make or modify the differentiated fork package to follow your own project Git code is uploaded to the project source.

Solution:

Scenario 1. Third-party Package management

http://tleyden.github.io/blog/2016/02/08/adding-vendoring-to-a-go-project/

Scenario 2: Manual Process

A. The Startup folder "/vendor/src" in the project root directory

B. Through the Git-subtree drop-down package to the previous step directory, the Red envelope part is the package address to be installed

git subtree add--prefix vendor/src/github.com/go-sql-driver/mysql https://github.com/go-sql-driver/ MySQL. Git master--squash

C. When a new package is required, you can change the add parameter to pull execution once

D. Add vendor folder and push to Git source

 

Complete

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.