当前位置:   article > 正文

beego安装_error: rpc failed; curl 56 gnutls recv error (-9):

error: rpc failed; curl 56 gnutls recv error (-9): error decoding the receiv

beego安装

root@b432f44ee2fe:/go/src# go get github.com/astaxie/beego 报错
cd .; git clone – https://gopkg.in/yaml.v2 /go/src/gopkg.in/yaml.v2
Cloning into ‘/go/src/gopkg.in/yaml.v2’…
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
package gopkg.in/yaml.v2: exit status 128
cd .; git clone – https://github.com/hashicorp/golang-lru /go/src/github.com/hashicorp/golang-lru
Cloning into ‘/go/src/github.com/hashicorp/golang-lru’…
fatal: unable to access ‘https://github.com/hashicorp/golang-lru/’: GnuTLS recv error (-9): Error decoding the received TLS packet.
package github.com/hashicorp/golang-lru: exit status 128
cd .; git clone – https://github.com/prometheus/client_golang /go/src/github.com/prometheus/client_golang
Cloning into ‘/go/src/github.com/prometheus/client_golang’…
fatal: unable to access ‘https://github.com/prometheus/client_golang/’: gnutls_handshake() failed: The TLS connection was non-properly terminated.
package github.com/prometheus/client_golang/prometheus/promhttp: exit status 128
package golang.org/x/crypto/acme/autocert: unrecognized import path “golang.org/x/crypto/acme/autocert”: https fetch: Get “https://golang.org/x/crypto/acme/autocert?go-get=1”: dial tcp: lookup golang.org on 192.168.65.1:53: read udp 172.17.0.7:34801->192.168.65.1:53: i/o timeout
解决方案:
go get github.com/labstack/echo

root@b432f44ee2fe:/go/src# go get github.com/labstack/echo
package golang.org/x/sys/unix: unrecognized import path “golang.org/x/sys/unix”: https fetch: Get “https://golang.org/x/sys/unix?go-get=1”: dial tcp 216.239.37.1:443: connect: connection refused
package golang.org/x/crypto/acme: unrecognized import path “golang.org/x/crypto/acme”: https fetch: Get “https://golang.org/x/crypto/acme?go-get=1”: dial tcp 216.239.37.1:443: connect: connection refused
package golang.org/x/crypto/acme/autocert: unrecognized import path “golang.org/x/crypto/acme/autocert”: https fetch: Get “https://golang.org/x/crypto/acme/autocert?go-get=1”: dial tcp 216.239.37.1:443: connect: connection refused
package golang.org/x/net/http2: unrecognized import path “golang.org/x/net/http2”: https fetch: Get “https://golang.org/x/net/http2?go-get=1”: dial tcp 216.239.37.1:443: connect: connection refused
package golang.org/x/net/http2/h2c: unrecognized import path “golang.org/x/net/http2/h2c”: https fetch: Get “https://golang.org/x/net/http2/h2c?go-get=1”: dial tcp 216.239.37.1:443: connect: connection refused
原因大家也是知道的!局域网没办法。
这里附上解决方案:
Go 1.11 版本开始,官方支持了 go module 包依赖管理工具。

其实还新增了 GOPROXY 环境变量。如果设置了该变量,下载源代码时将会通过这个环境变量设置的代理地址,而不再是以前的直接从代码库下载。这无疑对我等无法上网的开发良民来说是最大的福音。

更可喜的是,https://goproxy.io/ 这个开源项目帮我们实现好了我们想要的。该项目允许开发者一键构建自己的 GOPROXY 代理服务。同时,也提供了公用的代理服务 https://goproxy.io,我们只需设置该环境变量即可正常下载被墙的源码包了:

解决方案:
root@b432f44ee2fe:/go/src# export GO111MODULE=on
root@b432f44ee2fe:/go/src# export GOPROXY=https://goproxy.io
这里设置完毕我们就可以通过命令来进行获取依赖包了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/404408
推荐阅读
相关标签
  

闽ICP备14008679号