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

goctl api code generation error encountered.

Open csh995426531 opened this issue 1 year ago • 8 comments

Describe the bug Code generation error encountered.

To Reproduce I use the command:

  1. The code is

    goctl api go --api "./service/api/shiva.api" --dir "./service/api" --home "./service/api/.goctl"

  2. The error is

    2022/07/18 12:34:57 template: handlerTemplate:6:6: executing "handlerTemplate" at <.After1_1_10>: can't evaluate field After1_1_10 in type gogen.handlerInfo

Expected behavior success

Screenshots image

Environments (please complete the following information):

  • OS: mac os
  • go-zero version v1.3.4
  • goctl version v1.3.9

More description Add any other context about the problem here.

csh995426531 avatar Jul 18 '22 04:07 csh995426531

I had the same problem

21888 avatar Aug 05 '22 18:08 21888

How do you solve this problem

21888 avatar Aug 05 '22 18:08 21888

goctl version 1.3.9 windows/amd64

21888 avatar Aug 05 '22 18:08 21888

There is a problem in 1.3.9. If you go back to 1.3.8, you will be fine

21888 avatar Aug 05 '22 18:08 21888

Try it in v1.4.0

kevwan avatar Aug 18 '22 01:08 kevwan

Try it in v1.4.0

still error

linbuxiao avatar Aug 22 '22 07:08 linbuxiao

If you are a custom template, you can refer to the latest handler.tpl content to adjust the latest template has been moved out of the After1_1_10 variable, if not a custom template please first execute goctl template clean, and then goctl template init to reinitialize

kesonan avatar Sep 13 '22 11:09 kesonan

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

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