You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It fails to work now giving error scan called without calling next (closemuscanhold) in 1.22
Expected answer
How can we scan a row into multiple struct.
Something like this didn't work:
func MultiScan1(db *gorm.DB, rows *sql.Rows, items ...interface{}) error {
var records []any
records = append(records, items...)
err := db.ScanRows(rows, &records)
if err != nil {
return err
}
return nil
}
I know I can create a struct and embed all these structs and scan into it, but this is no go for us. We have hundred of places and scan scans into 5-10 structs often.
Looking a way to fix multi scan in a way that works.
The text was updated successfully, but these errors were encountered:
How to scan a row into multiple structs
The document you expected this should be explained
This code used to work with 1.20 go version
It fails to work now giving error
scan called without calling next (closemuscanhold)
in 1.22Expected answer
How can we scan a row into multiple struct.
Something like this didn't work:
I know I can create a struct and embed all these structs and scan into it, but this is no go for us. We have hundred of places and scan scans into 5-10 structs often.
Looking a way to fix multi scan in a way that works.
The text was updated successfully, but these errors were encountered: