2
goctl rpc proto -src .\b.proto -dir . -style go_zero
目录:
b.proto
common.proto
common.proto:
syntax = "proto3";
package common;
option go_package ="./src";
message RetResp {
bytes Data = 1;
}
message Empty {}
b.proto:
syntax = "proto3";
import "common.proto";
import "google/protobuf/empty.proto";
package b;
option go_package ="./src";
service B{
rpc Hello(common.Empty) returns(common.RetResp);
rpc Api(google.protobuf.Empty) returns(RetResp);
}
在上面引入google中的Empty和自己common.proto中定义的消息,goctl rpc proto生成代码都报错:request type must Defined in b.proto
协议版本:libprotoc 3.17.3 goctl :goctl.exe 版本 1.1.6 windows/amd64