kitex
kitex copied to clipboard
生成的fastpb代码里,没有使用包别名
images



hello.proto
syntax = "proto3";
package hello;
option go_package="pb/hello";
import "google/rpc/status.proto";
import "google/protobuf/any.proto";
message helloReq {
}
message helloResp {
google.rpc.Status status = 1;
google.protobuf.Any data = 2;
}
service api {
rpc hello (helloReq) returns (helloResp);
}
generate command
kitex -type protobuf \
-module gox.com/app/rpc/demo/hello \
-I . \
-I https://github.com/googleapis/googleapis \
-protobuf Mgoogle/protobuf/any.proto=gox.com/app/rpc/demo/hello/kitex_gen/pb/google/protobuf/any \
-protobuf Mgoogle/rpc/status.proto=gox.com/app/rpc/demo/hello/kitex_gen/pb/google/rpc/status \
-service gox.com-app-rpc-demo-hello \
hello.proto
go version go1.21.0 darwin/amd64