sqlrows
sqlrows copied to clipboard
panic: if referrer is nil
https://github.com/gostaticanalysis/sqlrows/blob/master/passes/sqlrows/sqlrows.go#L94
If refs is nil, *refs
become a panic.
Running into this as well. It would be helpful if it would not panic and say why or where this happens.
With this you can reproduce the issue
func issue9() {
var ctx context.Context
var db *sql.DB
rows, err := db.QueryContext(ctx, "SELECT * FROM users")
if err != nil {
log.Fatal(err)
}
defer rows.Close()
func() {
for rows.Next() {
rows.Scan()
}
}()
}