Skip to content

The issue of preserving the order of code generated automatically by goctl #4832

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

Open
lmh88 opened this issue May 5, 2025 · 2 comments
Open
Assignees
Labels
area/goctl Categorizes issue or PR as related to goctl. enhancement New feature or request

Comments

@lmh88
Copy link

lmh88 commented May 5, 2025

The code files types.go and routes.go generated automatically by goctl are generated in a different order each time. Submitting code for large-scale collaborative development projects can easily lead to conflicts. I hope the code generated by goctl can preserve its order every time. This can greatly reduce conflicts

@kevwan kevwan added enhancement New feature or request area/goctl Categorizes issue or PR as related to goctl. labels May 6, 2025
@kesonan
Copy link
Collaborator

kesonan commented May 11, 2025

pls paste the print value of goctl env here.

@lmh88
Copy link
Author

lmh88 commented May 12, 2025

the change in code order generated by gotl is not related to the environment variables of gotl As long as you modify the API and execute it a few times, the internal order of the generated routing file and types.go file will change.

goctl生成的代码顺序变化和goctl 的环境变量没有关系.只要你修改了api,甚至是微调,自己执行几次,生成的路由文件和types.go文件内部顺序就会变动. 看起来改动非常大.

PS D:\project\mygopro\mall_web_go> goctl env
GOCTL_OS=windows
GOCTL_ARCH=amd64
GOCTL_EXPERIMENTAL=off
GOCTL_HOME=C:\Users\admin.goctl
GOCTL_DEBUG=False
GOCTL_CACHE=C:\Users\admin.goctl\cache
GOCTL_VERSION=1.8.3
PROTOC_VERSION=
PROTOC_GEN_GO_VERSION=
PROTO_GEN_GO_GRPC_VERSION=

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. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants