Kitex builds thrift and reports error `error calling index: reflect: slice index out of range`

When using kitex or cwgo to generate rpc/http, an error occurs as shown below:
Insert image description here

add imports failed error: template: :1:5: executing "" at <index (index (index .Methods 0).Args 0).Deps 0>: error calling index: reflect: slice index out of range

The reason for this error is that kitex limits the number of generated method parameters to no more than 4.

Insert image description hereIn the above picture registerUser registered user input 4 parameters can be generated normally, but in the picture below there are many parameters, and a title error occurs.

Insert image description hereAt this time, define the structure and use the structure error parameters.

Insert image description here
Use the kitex command or cwgo command again to generate normally.

Guess you like

Origin blog.csdn.net/xwh3165037789/article/details/135099970