We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
IDL定义
syntax = "proto3"; package demo.export; option go_package = "demo/kitex_gen/provider"; import "google/protobuf/empty.proto"; message Response { int64 code = 1; } service DemoProvider { rpc Hello(google.protobuf.Empty) returns (Response) {} }
运行 kitex.exe 命令生成代码,最终生成的 demo\kitex_gen\provider\demoprovider\demoprovider.go 代码如下但不正确:
import ( emptypb "google.golang.org/protobuf/types/known/emptypb" ) type HelloArgs struct { Req *emptypb.Empty } func (p *HelloArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) { if !p.IsSetReq() { p.Req = new(emptypb.Empty) } return p.Req.FastRead(buf, _type, number) } func (p *HelloArgs) FastWrite(buf []byte) (n int) { if !p.IsSetReq() { return 0 } return p.Req.FastWrite(buf) } func (p *HelloArgs) Size() (n int) { if !p.IsSetReq() { return 0 } return p.Req.Size() }
代码提示错误:
*emptypb.Empty 没有 FastRead、FastWrite、Size 三个函数
The text was updated successfully, but these errors were encountered:
因为 fastpb 现在还没支持 google protoc 引用的产物生成 参考:cloudwego/fastpb#17
可以先执行 kitex 命令的时候带上 -no-fast-api 参数,把 fastpb 改为正常的 protobuf
Sorry, something went wrong.
No branches or pull requests
Describe the bug
IDL定义
运行 kitex.exe 命令生成代码,最终生成的 demo\kitex_gen\provider\demoprovider\demoprovider.go 代码如下但不正确:
代码提示错误:
The text was updated successfully, but these errors were encountered: