Skip to content
New issue

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

returns type must defined in ping.proto #3776

Closed
GuoxinL opened this issue Dec 11, 2023 · 1 comment
Closed

returns type must defined in ping.proto #3776

GuoxinL opened this issue Dec 11, 2023 · 1 comment

Comments

@GuoxinL
Copy link

GuoxinL commented Dec 11, 2023

Describe the bug
A clear and concise description of what the bug is.

May I ask why the object in the file cannot be referenced in the return value of go-zero rpc, which can be compiled successfully with the original command, why set this restriction in goctl

To Reproduce
Steps to reproduce the behavior, if applicable:

  1. The code is

    goctl rpc protoc ./ping.proto --go_out=./ping/pb --go-grpc_out=./ping/pb --zrpc_out=./ping -m -v
  2. The error is

    goctl rpc protoc ./ping.proto --go_out=./ping/pb --go-grpc_out=./ping/pb --zrpc_out=./ping -m -v
    

returns

[goctl-env]: preparing to check env

[goctl-env]: looking up "protoc"
[goctl-env]: "protoc" is installed

[goctl-env]: looking up "protoc-gen-go"
[goctl-env]: "protoc-gen-go" is installed

[goctl-env]: looking up "protoc-gen-go-grpc"
[goctl-env]: "protoc-gen-go-grpc" is installed

[goctl-env]: congratulations! your goctl environment is ready!
Error: line 16:3, returns type must defined in ping.proto
Usage:
  goctl rpc protoc [flags]

Examples:
goctl rpc protoc xx.proto --go_out=./pb --go-grpc_out=./pb --zrpc_out=.

Flags:
      --branch string     The branch of the remote repo, it does work with --remote
  -c, --client            Whether to generate rpc client (default true)
  -h, --help              help for protoc
      --home string       The goctl home path of the template, --home and --remote cannot be set at the same time, if they are, --remote has higher priority
  -m, --multiple          Generated in multiple rpc service mode
      --remote string     The remote git repo of the template, --home and --remote cannot be set at the same time, if they are, --remote has higher priority
                          The git repo directory must be consistent with the https://github.com/zeromicro/go-zero-template directory structure
      --style string      The file naming format, see [https://github.com/zeromicro/go-zero/blob/master/tools/goctl/config/readme.md]
  -v, --verbose           Enable log output
      --zrpc_out string   The zrpc output directory


line 16:3, returns type must defined in ping.proto

Expected behavior
A clear and concise description of what you expected to happen.

I want to be able to use goctl to generate RPC-related code that references other files in proto and structures in other proto files in parameter return values

Screenshots
If applicable, add screenshots to help explain your problem.

Generate code using goctl:

goctl rpc protoc ./ping.proto --go_out=./ping/pb --go-grpc_out=./ping/pb --zrpc_out=./ping -m -v
image

Generate code using protoc:
This is OK

protoc ./ping.proto --go_out=./ping/pb --go-grpc_out=./ping/pb

image

Environments (please complete the following information):

  • OS:
  • image
  • go-zero version v1.6.0
  • goctl version v1.6.0

More description
Add any other context about the problem here.

@GuoxinL GuoxinL changed the title returns type must defined in xxx.proto returns type must defined in ping.proto Dec 11, 2023
@kesonan
Copy link
Collaborator

kesonan commented Dec 11, 2023

duplicate issue with #3772

@kesonan kesonan closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants