Go Vendor Catalog

Source: Internet
Author: User

Reference 80327035

The solution for finding a dependent package path is as follows:
  • The vendor directory under the current package.
  • Locate the parent directory until you find the vendor directory under SRC.
  • Look for dependent packages under Gopath.
  • Look in the Goroot directory
Some of the recommendations in using vendor are as follows:
  • A library project (a package that does not contain main) should not store external packages in the vendor directory in its own version control unless they have special reasons and know why.
  • In one application, (containing the package for main), it is recommended that there is only one vendor directory at the code base level.
The reasons for the above recommendations are as follows:
  • An instance of each package in the directory structure, even the same version of the same package, will hit the final binary, and if everyone stores their own dependencies individually, it will quickly lead to a binary burst of makefile (binary bloat)
  • One of the pacage types in a directory is not compatible with the same package but in different directory types, even the same version of the package, which means that loggers, database connections, and other shared instances are not working.

Go Vendor Catalog

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.