Golang包管理工具之govendor的使用

栏目: Go · 发布时间: 6年前

1. 安装

go get -u -v github.com/kardianos/govendor
  1. 使用
#进入到项目目录

cd /home/gopath/src/mytool

#初始化vendor目录

govendor init

#查看vendor目录

[root@CC54425A mytool]# ls
commands  main.go  vendor  mytool_test.sh


#将GOPATH中本工程使用到的依赖包自动移动到vendor目录中
#说明:如果本地GOPATH没有依赖包,先go get相应的依赖包
govendor add +external
或使用缩写: govendor add +e 

#Go 1.6以上版本默认开启  GO 15VENDOREXPERIMENT 环境变量,可忽略该步骤。
#通过设置环境变量 GO15VENDOREXPERIMENT=1 使用vendor文件夹构建文件。
#可以选择 export GO15VENDOREXPERIMENT=1 或 GO15VENDOREXPERIMENT=1 go build 执行编译
export GO15VENDOREXPERIMENT=1

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Once Upon an Algorithm

Once Upon an Algorithm

Martin Erwig / MIT Press / 2017-9-8 / GBP 22.95

How Hansel and Gretel, Sherlock Holmes, the movie Groundhog Day, Harry Potter, and other familiar stories illustrate the concepts of computing. Picture a computer scientist, staring at a screen and......一起来看看 《Once Upon an Algorithm》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具