zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.38k stars 3.97k forks source link

not matching destination to scan #3817

Open zhenhua1 opened 11 months ago

zhenhua1 commented 11 months ago

d91779b8f3cb9cdf446420e9c169124

goctl 1.6.1代码报这个错误给指导一下

Issues-translate-bot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


d91779b8f3cb9cdf446420e9c169124

goctl 1.6.1 code reports this error, please give me some guidance.

kesonan commented 10 months ago

First of all, to be clear this is not a goctl problem, this is a usage problem, please post your structure, I suspect that you are querying a partial field, if it is a partial field please use the method QueryRowsPartial or QueryRowsPartialCtx to replace it.

Guvanchhojamov commented 5 months ago

Hi, @zhenhua1 Please send you SysUser structure example.

mzgmzg commented 5 months ago

作为出参的QueryRowsNoCacheCtx(ctx, &userList, sql2)函数的第二个实参从命名userList来看可能是[]User之类的类型,把sql里的count(*)改成*应该就可以了。

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The second actual parameter of the QueryRowsNoCacheCtx(ctx, &userList, sql2) function as an output parameter may be a type like []User from the name userList. Change count(*) in sql Changing it to * should be enough.