1. 程式人生 > >glide 解決 golang.org/x/net 等依賴包無法獲取

glide 解決 golang.org/x/net 等依賴包無法獲取

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