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

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

作者:互联网

 

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

  


标签:slice,dest,GetContext,报错,result,query,type,columns
来源: https://www.cnblogs.com/bobojiang/p/13204961.html