现象:
项目中引入了第三方包(github.com/jinzhu/copier),编译的时候出现了
go: github.com/jinzhu/copier@v0.3.5: verifying go.mod: github.com/jinzhu/copier@v0.3.5/go.mod: reading http://192.168.24.11:3000/sumdb/sum.golang.org/lookup/github.com/jinzhu/copier@v0.3.5: 502 Bad Gateway go: git.apache.org/thrift.git@v0.0.1 (replaced by bjgitlab.gnetis.com/golang/open-source/thrift-go.git@v0.0.1): missing go.sum entry; to add it: go mod download git.apache.org/thrift.git这个错误。
问题原因:
sum.golang.org无法访问,换一个sumdb就可以了
解决方案:
export GOSUMDB=sum.golang.google.cn