govendor使用及错误处理

1.govendor使用

#下载govendor 工具到本地
go get -u -v github.com/kardianos/govendor
#进入项目目录进行操作
#初始化
govendor init
#将依赖包自动移动到vendor目录中
govendor add +e

2.错误处理

#GOROOT 与GOPATTH工作目录不一样
1.错误为:
[root@mycetos7 ~]# go get -u -v github.com/kardianos/govendor
github.com/kardianos/govendor (download)
# cd /root/go/src/github.com/kardianos/govendor; git pull --ff-only
error: Your local changes to the following files would be overwritten by merge:
       .....
Please, commit your changes or stash them before you can merge.
Aborting
解决办法:
查看GOROOT 目录 下src/github  是否存在./kardianos/govendo,存在删除。

猜你喜欢

转载自blog.csdn.net/qqqqll3/article/details/88425567