安装 golang 失败。org/x/crypto/bcrypt

Failed to install golang.org/x/crypto/bcrypt

我正在尝试安装 InfluxDB 客户端。但是安装失败。这是我的踪迹:

go get -u -v -x github.com/influxdb/influxdb/client
github.com/influxdb/influxdb (download)
...
git remote -v
Fetching https://golang.org/x/crypto/bcrypt?go-get=1
[1]    6625 segmentation fault (core dumped)  go get -u -v -x github.com/influxdb/influxdb/client

我没有找到包 golang.org/x/crypto/bcryptGOROOTGOPATH.

当我尝试安装 crypto/bcrypt 时出现此错误:

go get -u -v golang.org/x/crypto/bcrypt
Fetching https://golang.org/x/crypto/bcrypt?go-get=1
[1]    7667 segmentation fault (core dumped)  go get -u -v golang.org/x/crypto/bcrypt

如何安装golang.org/x/crypto/bcrypt?

我的golang版本是go版本go1.4.2 gccgo

我找到了临时解决方案。

golang.org/x/crypto/bcryptgithub.

上有镜像

创建文件夹src/golang.org/x/放入你GOPATH

mkdir -p $GOPATH/src/golang.org/x/

然后从 github.

克隆 crypto
cd $GOPATH/src/golang.org/x/
git clone git@github.com:golang/crypto.git

我使用命令解决了它:

go get golang.org/x/crypto/bcrypt

1 - cd /usr/local/go/src/
2 - sudo mkdir x
3 - cd x
4 - sudo git clone https://github.com/golang/crypto.git
5 - restart vscode