报错 Scan error on column index 4, name "money": converting driver.Value type []uint8 ("0.100") to a int: invalid syntax
type Order struct{
Id int `"db:"id"`
Money float32 `"db:money"`
}
var order Order
rows, err = DB.Query("select money from order where id =1")
rows.Scan(&order.Money)
google 了半天,尝试了几种 decimal 类型仍然不行,
1
rimutuyuan 2020-11-26 18:10:49 +08:00
|
2
lalawac OP @rimutuyuan 谢谢, 搞定了
|