116182877544481197
前言
Go通过Exec函数执行SQL语句传递不定参时报错:sql: converting argument $1 type: unsupported type []interface {}, a slice of interface
原因
解决问题
1 2 3 4 5 6 7
| var args []interface{} args = append(args, "")
err := db.Exec( <sql>, args..., )
|
完成
参考文献
CSDN——初级使用者