Golang 常见问题记录

问题1 go get 失败找不到https://golang.org/x/crypto  网络问题

D:\projectRepository\golang\of-admin-go>go get -u github.com/jinzhu/gorm
go: github.com/jinzhu/gorm upgrade => v1.9.16
go get: github.com/jinzhu/gorm@v1.9.16 requires
        golang.org/x/crypto@v0.0.0-20191205180655-e7c4368fe9dd: unrecognized import path "golang.org/x/crypto": https fetch: Get "https://golang.org/x/crypto?go-get=1": dial tcp 142.251.42.241:443: connectex: A
 connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

解决
进入GOPATH的目录/src/golang.org/x/下,如果不存在,则手动创建,然后手动下载如下的包:

mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/net.git
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/crypto.git 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值