Skip to content

panic: *ssa.UnOp during rows.Close() #5

@nelsam

Description

@nelsam

The following code seems to cause sqlrows to panic:

rows, err := db.Query(a, b, c)
if err != nil {
    return err
}
func() {
    defer rows.Close()

    // read from rows...
}()

After digging in some, it seems that the deferred rows.Close() call inside of the closure is dereferencing the *sql.Rows value, because it comes out as an *ssa.UnOp instead of an *ssa.Extract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions