知道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