-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Exception occurs when using multilevel directory nesting in .api group: demo/login due to types file separation #4878
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
Comments
goctl version 1.8.3,今天也遇到这个问题 |
1.8.3 问题多多,还有inport api 后重复生成的问题 |
it fixed on |
I have watched the gotl source code for release 1.8.3 and found that this issue can be resolved by disabling the GOCTL.exe PERIMENTAL environment to disable the new API feature. However, it seems that this variable has always been enabled by default, so I haven't dealt with it either. At the same time, I solved this problem by using the latest version of goctl to enable API features. The main reason for upgrading is because I want to use the swagger generation function of the gotl API. After using it, I fixed the issue with the gotl swagger plugin. I would like to know if the official and stable 1.8.4 version of gotl will be released soon. |
Yes, within 2 weeks. go-zero usuallly release every month. |
Fixed in master. close now, reopen if needed. |
Uh oh!
There was an error while loading. Please reload this page.
Exception occurs when using multilevel directory nesting in .api group: demo/login due to types file separation
Error message:
2025/05/20 21:06:44 open internal/types/demo/login.go: no such file or directory
@server (
// Represents that the route generation code under the current service code block will be placed in the login directory
group: demo/login
// Defines the route prefix as "/v1"
prefix: /v1
)
The following example can be generated:
@server (
// Represents that the route generation code under the current service code block will be placed in the login directory
group: login
// Defines the route prefix as "/v1"
prefix: /v1
)
当.api的group: demo/login多层级目录嵌套会因为types的分文件导致异常
报错内容
2025/05/20 21:06:44 open internal/types/demo/login.go: no such file or directory
@server (
// 代表当前 service 代码块下的路由生成代码时都会被放到 login 目录下
group: demo/login
// 定义路由前缀为 "/v1"
prefix: /v1
)
下面这一种是可以生成的
@server (
// 代表当前 service 代码块下的路由生成代码时都会被放到 login 目录下
group: login
// 定义路由前缀为 "/v1"
prefix: /v1
)
The text was updated successfully, but these errors were encountered: