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

goctl rpc generated the unexpected contents. #3688

Open
anyone0034 opened this issue Nov 2, 2023 · 5 comments
Open

goctl rpc generated the unexpected contents. #3688

anyone0034 opened this issue Nov 2, 2023 · 5 comments
Labels
area/goctl Categorizes issue or PR as related to goctl. stale

Comments

@anyone0034
Copy link

goctl rpc生成的代码,其中logic分组名称没有按照style指定的样式生成。

例如:logic/minitest,我想要的是logic/mini_test的目录。

  1. mini_core.proto文件

    syntax = "proto3";

package mini_core;
option go_package="./mini_core";

message MiniTestReq{}
message MiniTestResp{}

service MiniTest {
rpc MiniTest(MiniTestReq) returns(MiniTestResp);
}


2. 生成代码:

goctl rpc protoc mini_core.proto --go_out=./types --go-grpc_out=./types --zrpc_out=. --style=go_zero -m

3. 生成结果:

├─internal
│ ├─config
│ │ config.go
│ │
│ ├─logic
│ │ │
│ │ └─minitest // 其中,我想要的结果是: mini_test
│ │ mini_test_logic.go
│ │
│ ├─server
│ │ │
│ │ └─minitest
│ │ mini_test_server.go
│ │


**Environments (please complete the following information):**
 - OS: [e.g. Linux] windows
 - go-zero version [e.g. 1.2.1] v1.5.4
 - goctl version [e.g. 1.2.1, optional] goctl version 1.6.0 windows/amd64
@kesonan
Copy link
Collaborator

kesonan commented Nov 2, 2023

The suffix _logic generated by goctl, it can't be removed.

@kevwan kevwan added the area/goctl Categorizes issue or PR as related to goctl. label Nov 3, 2023
@kevwan kevwan changed the title goctl rpc生成的目录,没有得到想要的结果。 goctl rpc generated the unexpected contents. Nov 3, 2023
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This problem has been reported before, and it seems that it has not been changed. Now for the naming of this combination, the proto is currently written in the desired style.

@fucktx
Copy link

fucktx commented Nov 7, 2023

感觉这里有好几个问题
1:minitest // 其中,我想要的结果是: mini_test
2:已经是logic目录下了,文件名为嘛不是mini_test.go,而是mini_test_logic.go,多了一个logic
3:文件里面,package中已经包含logic了,里面的结构体和函数名还存在Logic

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I feel like there are several issues here
1:minitest // Among them, the result I want is: mini_test
2: It is already in the logic directory. The file name is not mini_test.go, but mini_test_logic.go. There is one more logic.
3: In the file, the package already contains logic, and the structures and function names inside still exist in Logic.

Copy link

github-actions bot commented Nov 9, 2024

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

@github-actions github-actions bot added the stale label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/goctl Categorizes issue or PR as related to goctl. stale
Projects
None yet
Development

No branches or pull requests

5 participants