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

When use gf gen service,the nested struct can't get generate there own functions #3104

Closed
ppxb opened this issue Oct 27, 2023 · 5 comments · Fixed by #3488
Closed

When use gf gen service,the nested struct can't get generate there own functions #3104

ppxb opened this issue Oct 27, 2023 · 5 comments · Fixed by #3488
Labels
feature help wanted planned This issue/proposal is planned into our next steps.

Comments

@ppxb
Copy link

ppxb commented Oct 27, 2023

1. What version of Go and system type/arch are you using?

Go Version: 1.20

2. What version of GoFrame are you using?

GoFrame Version: v2.54

3. Can this issue be re-produced with the latest release?

Not sure

4. What did you do?

When use gf gen service, the nested struct can't generate there own functions

codes below:

type sToken struct {
	*gftoken.GfToken
}

func init() {
	service.RegisterToken(New())
}

5. What did you expect to see?

service should auto generate the GfToken's functions

6. What did you see instead?

empty implements about GfToken struct

@gqcn gqcn added enhancement help wanted planned This issue/proposal is planned into our next steps. labels Nov 2, 2023
Copy link

github-actions bot commented Nov 2, 2023

Hello @ppxb. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @ppxb。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@gqcn gqcn added feature and removed enhancement labels Nov 2, 2023
@gqcn
Copy link
Member

gqcn commented Nov 2, 2023

@ppxb It needs some improvement for command gen service for such feature. It's now using regular expression to implement service go files generating, which is simple and quick. If recognizing nested struct, it might use ast to do so, which might be slow. We need balance the benefits between regular expression and ast plan.

cc @oldme-git you might be interested as we've discussed similar topic recently.

@oldme-git
Copy link
Member

oldme-git commented Nov 2, 2023

@gqcn I will pay attention to this issue recently.

@ppxb
Copy link
Author

ppxb commented Nov 2, 2023

@gqcn @oldme-git thanks for your attention.
i have resolved this problem temporarily through delete the gf gen service file's TOP COMMENT to customized the interface implements.
it works.
goframe is a good framework for golang.
thanks again.

@oldme-git
Copy link
Member

Please show #3067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted planned This issue/proposal is planned into our next steps.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants