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

推荐阅读更多精彩内容