因为众所周知的缘由,golang在下载golang.org的包时会出现访问不了的状况。尤为是x包,不少库都依赖于它。因为x包在github上都有镜像,咱们能够使用从github.com上先clone下来,再作软连接的方式曲线救国。git
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