Is it possible to reuse the same *sql.Rows
after the *sql.Rows.Next()
was called so I could pass it to another function?
rows, err := db.Query(...)
for rows.Next() {
// rows.Scan()
}
anotherFunction(rows) // NOT WORKING: This rows became empty.
I tried to make another copy of the *sql.Rows
but it didn't work.
rows, err := db.Query(...)
anotherRows := *rows
// PANIC: call of load copies lock value: database/sql.Rows contains sync.RWMutex