47

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

 5 years ago
source link: https://studygolang.com/articles/20343?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

由于众所周知的原因,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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK