go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

logic code function is unconsistence with handler function define.

Open mazhan465 opened this issue 1 year ago • 2 comments

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: image

  1. 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.

mazhan465 avatar Mar 06 '23 03:03 mazhan465

I know the problem.When I use generate with goctl-go-compact , this error occur.But it work normally when not goctl-go-compact.

mazhan465 avatar Mar 08 '23 06:03 mazhan465

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Mar 23 '24 01:03 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 27 '24 01:06 github-actions[bot]