golang 中使用mysql报错:“ scannable dest type slice with >1 columns (4) in result”

时间:2020-06-28 21:23:06   收藏:0   阅读:533

 

query := fmt.Sprintf("SELECT ....
infos = make([]*struct, 0, 10)
err = s.db.GetContext(ctx, &infos, query)

  返回错误:

scannable dest type slice with >1 columns (4) in result

  解决办法:

替换

 

GetContext

  为:

SelectContext

  

原文:https://www.cnblogs.com/bobojiang/p/13204961.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!