Golang 常见问题记录
Posted oufu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
以上是关于Golang 常见问题记录的主要内容,如果未能解决你的问题,请参考以下文章