知道glide有设置镜像功能,可以把某个依赖包的源地址切换为另一个地址,相当于切换到镜像地址,用于某些依赖包被墙的原因
之前碰到 golang.org/x/net,设置镜像:
glide mirror set golang.org/x/crypto github.com/golang/crypto
发现没有效果,还是会报error
[WARN] Unable to checkout golang.org/x/crypto [ERROR] Update failed for golang.org/x/crypto: Cannot detect VCS [ERROR] Failed to do initial checkout of config: Cannot detect VCS
于是换成下面的 mirror 方式:
$ glide mirror set https://golang.org/x/mobile https://github.com/golang/mobile --vcs git $ glide mirror set https://golang.org/x/crypto https://github.com/golang/crypto --vcs git $ glide mirror set https://golang.org/x/net https://github.com/golang/net --vcs git $ glide mirror set https://golang.org/x/tools https://github.com/golang/tools --vcs git $ glide mirror set https://golang.org/x/text https://github.com/golang/text --vcs git $ glide mirror set https://golang.org/x/image https://github.com/golang/image --vcs git $ glide mirror set https://golang.org/x/sys https://github.com/golang/sys --vcs git