官方资料:

效果

  • 逐层递归向上查找遇到的 vendor 目录,直到找到目标内容
  • 若 vendor 目录中没有找到目标,最后会去 go 的标准目录下查找

Quick Start

# Setup your project.
cd "my project in GOPATH"
govendor init # Add existing GOPATH files to vendor.
govendor add +external # View your work.
govendor list # Look at what is using a package
govendor list -v fmt # Specify a specific version or revision to fetch
govendor fetch golang.org/x/net/context@a4bbce9fcae005b22ae5443f6af064d80a6f5a55
govendor fetch golang.org/x/net/context@v1 # Get latest v1.*.* tag or branch.
govendor fetch golang.org/x/net/context@=v1 # Get the tag or branch named "v1". # Update a package to latest, given any prior version constraint
govendor fetch golang.org/x/net/context # Format your repository only
govendor fmt +local # Build everything in your repository only
govendor install +local # Test your repository only
govendor test +local

FAQ

Q: How do I test only my packages?
  A: Run govendor test +local.
Q: How do I build install all my vendor packages?
  A: Run govendor install +vendor,^program.
Q: How do I pull all my dependencies from network remotes?
  A: Run govendor fetch +out.
Q: I have a working program with dependencies in $GOPATH. I want to vendor now.
  A: Run govendor add +external.
Q: I have copied dependencies into "vendor". I want to update from $GOPATH.
  A: Run govendor update +vendor.
Q: I'm getting missing packages from appengine but I don't care about appengine. How do I ignore these packages?
  A: Edit the vendor/vendor.json file. Update the "ignore" field to include "appengine". If you are already ignoring tests, it will look like: "ignore": "test appengine",.
Q: I have modified a package in $GOPATH and I want to try the changes in vendor without committing them.
  A: Run govendor update -uncommitted <updated-package-import-path>.
Q: I've forked a package and I haven't upstreamed the changes yet. What should I do?
  A: Assuming you've pushed your changes to an accessable repository, run govendor fetch github.com/normal/pkg::github.com/myfork/pkg. This will fetch from "myfork" but place package in "normal".
Q: I have C files or HTML resources in sub-folders. How do I ensure they are copied as well?
  A: Run either govendor fetch github.com/dep/pkg/^ or govendor add github.com/dep/pkg/^. This is the same as using the -tree argument.
Q: How do I prevent vendor source from being checked in?
  A: Add vendor/*/ to your ignore file.
Q: How do I populate the vendor folder if it has not been checked in?
  A: Run govendor sync.

...

最新文章

  1. 9月12日JavaScript脚本语言
  2. PC端 $_SERVER 说明
  3. 关于 2dx v3.7 UIScale9Sprite的bug
  4. 使用FTP删不掉文件的解决方法
  5. CSS3----border-sizing
  6. node.js实践第二天
  7. php sprintf函数
  8. 从async await 报错Unexpected identifier 谈谈对上下文的理解
  9. Prism for WPF初探(构建简单的模块化开发框架)
  10. List、Map、Set之间的联系与区别:
  11. Android第一次作业
  12. 我与Vuex的第一次邂逅
  13. py库: GUI(tkinter)
  14. LY.JAVA面向对象编程.final、多态、抽象类、接口
  15. 2、以自定义struct或struct指针作为map的Key
  16. XCode中常用错误解决
  17. 用Eclipse进行远程Debug代码 (转)
  18. MySQL5.7 centos7.2 yum 安装
  19. sql server 复制表从一个数据库到另一个数据库
  20. Unity AssetServer小笔记

热门文章

  1. JS-动态加载
  2. jsp中jstl、el使用
  3. (转)Git 提交的正确姿势:Commit message 编写指南
  4. 执行sudo apt-get update报错
  5. 04、python的基础--&gt;列表跟元组
  6. datepicker时间选择弹窗
  7. QQ邮箱客户端配置
  8. Python 字符串常用判断函数
  9. Jsoup爬虫任务总结
  10. vue-cli 中多个组件共用一个mt-checklist