拾遗:govendor(Golang 依赖库版本控制)
官方资料:
效果
- 逐层递归向上查找遇到的 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.
...
拾遗:govendor(Golang 依赖库版本控制)的更多相关文章
- node.js之看懂package.json依赖库版本控制
金天:学习一个新东西,就要持有拥抱的心态,如果固守在自己先前的概念体系,就会有举步维艰的感觉.node.js依赖库的版本控制 一般node.js项目会依赖大量第三方module, 那么如何控制modu ...
- golang 标准库间依赖的可视化展示
简介 国庆看完 << Go 语言圣经 >>,总想做点什么,来加深下印象.以可视化的方式展示 golang 标准库之间的依赖,可能是一个比较好的切入点.做之前,简单搜了下相关的内 ...
- Golang依赖管理工具:glide从入门到精通使用
这是一个创建于 2017-07-22 05:33:09 的文章,其中的信息可能已经有所发展或是发生改变. 介绍 不论是开发Java还是你正在学习的Golang,都会遇到依赖管理问题.Java有牛逼轰轰 ...
- WeedFS依赖库 0.6.1
WeedFS依赖库 版本 0.6.1 =======================================================================glog====== ...
- golang 依赖控制反转(IoC)
主流开发语言,为了达到项目间的低耦合,都会借助IoC框架来实现.即抽象和实现分离,使用抽象层,不用关心这些抽象层的具体实现:抽象层的实现,可以独立实现.现在比较流行的领域驱动设计(ddd),为了达到将 ...
- 使用 Swift Package Manager 集成依赖库
本文首发于 Ficow Shen's Blog,原文地址: 使用 Swift Package Manager 集成依赖库. 内容概览 前言 添加依赖包 在项目中使用依赖 管理已导入的依赖 在团 ...
- 一种优雅的Golang的库插件注册加载机制
一种优雅的Golang的库插件注册加载机制 你好,我是轩脉刃. 最近看到一个内部项目的插件加载机制,非常赞.当然这里说的插件并不是指的golang原生的可以在buildmode中加载指定so文件的那种 ...
- 系列篇|编译可在Android上运行的依赖库(一):glib库
前言 这是系列文章,它们由<编译可在Android上运行的glib库>及其他4篇文章组成,这4篇文章在“编译依赖库”一节中列出.由于glib库依赖于其他第三方库,所以需要先将依赖的第三方库 ...
- 钉钉js依赖库学习
看别人用的依赖库的好处在于,你知道有什么可以用,什么可以借鉴.(钉钉——协作桌面应用) PS:人最怕是不知道,而不是你不会. 1. jQuery 钉钉使用了1.9.1版本的jQuery,jQuery作 ...
随机推荐
- jquery实现的ajax
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEnco ...
- jquery中attr方法和prop方法的区别
关于checked的属性,最重要的概念就是你要记住,它跟checked的状态值是毫无关系的,设置checked = "checked"或者checked = "true& ...
- 31. Git与Github
Github介绍 GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名gitHub. GitHub于2008年4月10日正式上线,除了Git代码仓库 ...
- Forgery CodeForces - 1059B
一道印章刻印的题目: 具体要求:有一个固定的3*3的印章,给你一个墨迹问能用这个印章印出墨迹吗?(一个像素可以多次被上色) 输入:第一行是墨迹的行列规模,接下来是墨迹 输出:If Andrey can ...
- Java.math.BigDecimal.abs()方法
java.math.BigDecimal.abs()返回一个BigDecimal,其值是此BigDecimal的绝对值,其标度是this.scale(). 声明 以下是java.math.BigDec ...
- Django 模型层关系映射
一.一对一映射 1.什么是一对一 A表中的一条记录只能与B表中的一条记录相关联如:一夫一妻制 2.语法 允许在关联的两个类的任何一个类中 增加: 属性 = models.OneToOneField(E ...
- .NET简介
| 版权声明:本文为博主原创文章,未经博主允许不得转载. 微软跨语言运行的主要机制就如上图类似,其最重要的部分是CLR和MSIL:其中MSIL是微软中间语言,它的主要的作用是将不同 的语言,如:C ...
- java部署:CentOS 7下Tomcat安装与配置教程(Tomcat开机启动)
一.前言 1.本教程主要内容 Tomcat安装与基础配置 Tomcat开机启动配置 2.本教程适用范围与环境信息 适用范围 软件/工具 版本说明 CentOS CentOS 7 Tomcat Tomc ...
- 跨域篇--JSONP原理
一篇文章让你明白 jsonp原理详解 什么是JSONP? 先说说JSONP是怎么产生的: 其实网上关于JSONP的讲解有很多,但却千篇一律,而且云里雾里,对于很多刚接触的人来讲理解起来有些困难,着用自 ...
- js事件处理程序详解,html事件处理程序,dom0级事件处理程序,dom2级事件处理程序
博客搬迁,给你带来的不便,敬请谅解! http://www.suanliutudousi.com/2017/11/24/js%e4%ba%8b%e4%bb%b6%e5%a4%84%e7%90%86%e ...