Go_errors RPC failed; curl 18 transfer closed with outstanding read data remaining

安装GIn的时候报错
指令 go get -u github.com/gin-gonic/gin
报错信息:

# cd .; git clone -- [https://github.com/go-playground/locales](https://github.com/go-playground/locales)/$(GOPATH)/src/[github.com/go-playground/locales](http://github.com/go-playground/locales)
Cloning into '/$(GOPATH)/src/[github.com/go-playground/locales](http://github.com/go-playground/locales)'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
package [github.com/go-playground/locales](http://github.com/go-playground/locales): exit status 128

两种解决办法可以依次尝试

1.修改git缓存大小(500M)

git config --global http.postBuffer 524288000

通过 git config --list 查看配置

如果上面的方法没有生效,则:

2.直接把报错的库拉下来

分析一下报错信息,是git clone github.com/go-playground/locales失败,所以直接把go-playground/locales搞下来就行

$ go get http://github.com/go-playground/locales

上一步完成后继续执行
go get -u github.com/gin-gonic/gin
即可

终极解决办法:

使用go mod

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容