zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.41k stars 3.97k forks source link

use new version grpc,package test; option go_package = "test"; Report an error with the same name #1354

Closed jan-bar closed 2 years ago

jan-bar commented 2 years ago

I use the following version

goctl.exe -v
goctl.exe version 1.2.4-cli windows/amd64

protoc --version
libprotoc 3.19.1

github.com/tal-tech/go-zero v1.2.4
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.27.1

github.com/golang/protobuf/protoc-gen-go@v1.5.2

I have the following proto file,I want to use the test with the same name,For compatibility with older versions。
旧版本没有option go_package字段生成的代码和grpc调用已经固定,新版本搞成不一样影响比较大。

package test;
option go_package = "test";

use goctl rpc proto --home %GOCTLHOME% -style goZero -dir . -src test.proto Report an error

image

Below is the result I want,我单独执行命令是允许使用相同名称的情况

image

I found that it is the result of the following code image

时间都花在用翻译软件上了 462767AA

wilsonliu123 commented 2 years ago

I also have the same problem

kesonan commented 2 years ago

grpc 生成是一个很难的问题,protoc-gen-go多版本兼容,proto 语法版本等都给 goctl 生成带来了很大的挑战,目前我们针对以上问题整理一个优化方案: 点击跳转,你可以下载该方案中的 goctl 尝试解决一下,目前该方案在内测中,如果还是不能解决你的问题,可以 github 直接@anqiansong,如果你在微信群里,你也可以@KesonAnn

Grpc generation is a difficult problem. Multi-version compatibility of protoc-gen-go, proto syntax version, etc. have brought great challenges to goctl generation. At present, we have compiled an optimization solution for the above problems. The link to the solution is as follows,[see details](https:/ /github.com/zeromicro/go-zero/issues/1226) , you can download the goctl in this solution and try to solve it. At present, the solution is in internal testing. If it still does not solve your problem, you can directly @anqiansong on github, if You are in the WeChat group, you can also @KesonAnn

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.