美文网首页Golang我爱编程
Golang 解决 golang.org/x/ 下包下载不下来的

Golang 解决 golang.org/x/ 下包下载不下来的

作者: imec | 来源:发表于2018-04-30 15:56 被阅读0次

由于众所周知的原因,golang在下载golang.org的包时会出现访问不了的情况。尤其是x包,很多库都依赖于它。由于x包在github上都有镜像,我们可以使用从github.com上先clone下来,再做软链接的方式曲线救国。

mkdir -p $GOPATH/src/github.com/golang/
git clone https://github.com/golang/sys.git $GOPATH/src/github.com/golang/sys
git clone https://github.com/golang/net.git $GOPATH/src/github.com/golang/net
git clone https://github.com/golang/text.git $GOPATH/src/github.com/golang/text
git clone https://github.com/golang/lint.git $GOPATH/src/github.com/golang/lint
git clone https://github.com/golang/tools.git $GOPATH/src/github.com/golang/tools
git clone https://github.com/golang/crypto.git $GOPATH/src/github.com/golang/crypto

ln -s $GOPATH/src/github.com/golang/ $GOPATH/src/golang.org/x

相关文章

网友评论

    本文标题:Golang 解决 golang.org/x/ 下包下载不下来的

    本文链接:https://www.haomeiwen.com/subject/huozlftx.html