go-zero
go-zero copied to clipboard
logic code function is unconsistence with handler function define.
Describe the bug I generate go api code and logic code function is unconsistence with handler function define.
To Reproduce
this is my api proto define:
-
The code is
func (l *AddTopicLogic) AddTopic(req types.AddTopicReq) (resp *types.CommonResp, err error) { // todo: add your logic here and delete this line
return
}
2. The error is
cannot use &req (value of type *types.AddTopicReq) as types.AddTopicReq value in argument to l.AddTopic
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
<img width="831" alt="image" src="https://user-images.githubusercontent.com/20238053/223013139-8a2f2f65-fb42-4ca8-956e-4edf74c86bc1.png">
<img width="745" alt="image" src="https://user-images.githubusercontent.com/20238053/223013171-bbd0cd6e-07c5-44c6-ad25-9e5e19cd5d7f.png">
**Environments (please complete the following information):**
- OS: mac12.6
- go-zero version v1.4.4
**More description**
Add any other context about the problem here.
I know the problem.When I use generate with goctl-go-compact , this error occur.But it work normally when not goctl-go-compact.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.