gf
gf copied to clipboard
When use gf gen service,the nested struct can't get generate there own functions
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
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。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。
@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.
@gqcn I will pay attention to this issue recently.
@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.
Please show #3067