kratos tool protoc api.proto失败问题解决

输入log如下

kratos tool protoc --bm api.proto
go get -u github.com/bilibili/kratos/tool/kratos-protoc
go: finding github.com/cznic/strutil latest
go: finding github.com/samuel/go-zookeeper latest
go: finding github.com/cznic/mathutil latest
go: finding github.com/dgryski/go-farm latest
go: finding github.com/siddontang/go latest
go: finding golang.org/x/net latest
go: finding github.com/StackExchange/wmi latest
go: finding github.com/modern-go/concurrent latest
go: finding github.com/aristanetworks/goarista latest
go: finding golang.org/x/tools latest
go: finding github.com/shirou/w32 latest
go: finding golang.org/x/sys latest
go: finding golang.org/x/time latest
go: finding github.com/prometheus/client_model latest
go: finding google.golang.org/genproto latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/lint latest
go: finding golang.org/x/oauth2 latest
go: finding github.com/tsuna/gohbase latest
go: finding golang.org/x/crypto latest
go: finding github.com/golang/groupcache latest
go: finding github.com/coreos/pkg latest
go: finding gopkg.in/check.v1 latest
go: finding golang.org/x/xerrors latest
go: finding github.com/remyoudompheng/bigfft latest
go: finding gopkg.in/tomb.v1 latest
go: finding github.com/eapache/go-xerial-snappy latest
go: finding github.com/xiang90/probing latest
go: finding github.com/streadway/amqp latest
go: finding github.com/rcrowley/go-metrics latest
go: finding github.com/cockroachdb/datadriven latest
go: finding github.com/tmc/grpc-websocket-proxy latest
go: finding golang.org/x/exp latest
go: finding github.com/mwitkow/go-conntrack latest
go: finding github.com/alecthomas/units latest
go: finding github.com/golang/glog latest
go: finding github.com/coreos/go-systemd latest
go: finding github.com/cznic/b latest
go: finding github.com/alecthomas/template latest
go: finding dmitri.shuralyov.com/gpu/mtl latest
go: finding golang.org/x/image latest
go: finding github.com/kr/logfmt latest
go: finding github.com/BurntSushi/xgb latest
go: finding github.com/openconfig/reference latest
go: finding github.com/google/pprof latest
go: finding github.com/aristanetworks/glog latest
go: finding github.com/go-gl/glfw latest
go: finding github.com/xdg/scram latest
go: finding github.com/openconfig/gnmi latest
go: finding github.com/xtaci/lossyconn latest
go: finding golang.org/x/mobile latest
go: finding gopkg.in/bsm/ratelimit.v1 latest
go: finding github.com/influxdata/influxdb1-client latest
go: finding github.com/jstemmer/go-junit-report latest
go: finding github.com/templexxx/xor latest
go: finding github.com/armon/consul-api latest
go: finding github.com/templexxx/cpufeat latest
go: gopkg.in/jcmturner/rpc.v1@v1.1.1: parsing go.mod: missing module line
go get: error loading module requirements
2019/09/19 14:11:56 go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-bm
go: finding github.com/aristanetworks/goarista latest
go: finding github.com/dgryski/go-farm latest
go: finding github.com/cznic/mathutil latest
go: finding golang.org/x/sys latest
go: finding golang.org/x/crypto latest
go: finding gopkg.in/check.v1 latest
go: finding github.com/cznic/strutil latest
go: finding github.com/prometheus/client_model latest
go: finding github.com/StackExchange/wmi latest
go: finding github.com/tmc/grpc-websocket-proxy latest
go: finding golang.org/x/net latest
go: finding github.com/modern-go/concurrent latest
go: finding github.com/coreos/go-systemd latest
go: finding gopkg.in/tomb.v1 latest
go: finding github.com/tsuna/gohbase latest
go: finding golang.org/x/sync latest
go: finding google.golang.org/genproto latest
go: finding github.com/cznic/b latest
go: finding github.com/remyoudompheng/bigfft latest
go: finding github.com/cockroachdb/datadriven latest
go: finding github.com/streadway/amqp latest
go: finding golang.org/x/lint latest
go: finding github.com/golang/glog latest
go: finding github.com/siddontang/go latest
go: finding github.com/mwitkow/go-conntrack latest
go: finding golang.org/x/time latest
go: finding golang.org/x/tools latest
go: finding github.com/eapache/go-xerial-snappy latest
go: finding github.com/golang/groupcache latest
go: finding github.com/samuel/go-zookeeper latest
go: finding github.com/xiang90/probing latest
go: finding github.com/templexxx/xor latest
go: finding gopkg.in/bsm/ratelimit.v1 latest
go: finding github.com/kr/logfmt latest
go: finding golang.org/x/exp latest
go: finding github.com/rcrowley/go-metrics latest
go: finding github.com/armon/consul-api latest
go: finding github.com/alecthomas/units latest
go: finding golang.org/x/oauth2 latest
go: finding golang.org/x/xerrors latest
go: finding github.com/xtaci/lossyconn latest
go: finding github.com/templexxx/cpufeat latest
go: finding github.com/openconfig/reference latest
go: finding github.com/coreos/pkg latest
go: finding github.com/jstemmer/go-junit-report latest
go: finding github.com/alecthomas/template latest
go: finding github.com/go-gl/glfw latest
go: finding github.com/influxdata/influxdb1-client latest
go: finding github.com/BurntSushi/xgb latest
go: finding github.com/openconfig/gnmi latest
go: finding golang.org/x/image latest
go: finding github.com/aristanetworks/glog latest
go: finding github.com/shirou/w32 latest
go: finding github.com/google/pprof latest
go: finding github.com/xdg/scram latest
go: gopkg.in/jcmturner/rpc.v1@v1.1.1: parsing go.mod: missing module line
go: finding dmitri.shuralyov.com/gpu/mtl latest
go get: error loading module requirements
exit status 1

Go

因为rpcl go get 失败导致。

具体原因可以参考该issues

github.com/golang/go/issues/34033

解决办法

在go.mod加入

replace gopkg.in/jcmturner/rpc.v1 v1.1.1 => gopkg.in/jcmturner/rpc.v1 v1.1.0

将1.1.1替换掉就可以了

本文链接:

https://www.bobsong.net/1210.html
1 + 2 =
快来做第一个评论的人吧~