两种解决方式:

1、软链接

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

2、手工创建

go env 查看 go path
进入或创建目录:
$GOPATH/src/golang.org/x
进入目录,git clone github.com上项目代替

git clone https://github.com/golang/sys.git 
git clone https://github.com/golang/net.git 
git clone https://github.com/golang/text.git 
git clone https://github.com/golang/lint.git 
git clone https://github.com/golang/tools.git 
git clone https://github.com/golang/crypto.git

 

总结:之所以下载不下来是因为 golang.org 被墙了,而 Google 已经这些包上传至 github,我们只需要去 github 下载即可。把包名 golang.org/x/{packname} 替换成 github.com/golang/{packname},然后执行 go get 下载,最后是给 $GOPATH/src/github.com/golang 目录做一个软连接映射到 $GOPATH/src/golang.org/x

原文地址:https://blog.csdn.net/wukongbajieheti/article/details/97934747