glide 我就不做过多介绍了,它是golang的包管理工具之一,由于该工具github上面不在维护,官方也推荐使用dep,所以之前也使用过dep,但是由于 dep 一直拉取不了 golang.org/x 相关依赖,无奈只能又切回 glide。
坑位
拉取 golang.org/x 相关包同样失败,报 Cannot detect VCS
解决方案
12345678// 替换拉取镜像glide mirror set https://golang.org/x/mobile https://github.com/golang/mobile --vcs gitglide mirror set https://golang.org/x/crypto https://github.com/golang/crypto --vcs gitglide mirror set https://golang.org/x/net https://github.com/golang/net --vcs gitglide mirror set https://golang.org/x/tools https://github.com/golang/tools --vcs gitglide mirror set https://golang.org/x/text https://github.com/golang/text --vcs gitglide mirror set https://golang.org/x/image https://github.com/golang/image --vcs gitglide mirror set https://golang.org/x/sys https://github.com/golang/sys --vcs git
私库的包拉取不了
解决方案
12// 同样替换拉取镜像glide mirror set [本地代码中import的包名,例如:test/keng] [对应私库的地址(http://host/test/keng] --vcs git
无法拉取子包
假设你要拉取的包在glide.yaml中配置如下:
1- package: golang.org/x/net/context此时同样会报 Cannot detect VCS,因为不支持拉取子包
解决方案
修改glide.yaml中的配置如下:
123- package: golang.org/x/netsubpackages:- context