由于眾所周知的原因,golang在下載golang.org的包時(shí)會(huì)出現(xiàn)訪問(wèn)不了的情況。尤其是x包,很多庫(kù)都依賴于它。由于x包在github上都有鏡像,我們可以使用從github.com上先clone下來(lái),再做軟鏈接的方式曲線救國(guó)。
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