kitex构建thrift报错`error calling index: reflect: slice index out of range`

使用kitex或者cwgo生成rpc/http时报错如下图所示:
在这里插入图片描述

add imports failed error: template: :1:5: executing "" at : error calling index: reflect: slice index out of range

出现该错误的原因是kitex限制了生成方法参数的个数不能超过4个。

kitex构建thrift报错`error calling index: reflect: slice index out of range`_第1张图片在上图registerUser中注册了用户传入4个参数可以正常生成,但是下图出现了众多参数,就出现了标题的错误。

在这里插入图片描述这时定义结构体,以结构体错误参数即可。

在这里插入图片描述
再次使用kitex命令或者cwgo命令正常生成。

你可能感兴趣的:(SHARE,Go,#,CloudWeGo,kitex,cwgo,golang)