Skip to content

panic: *ssa.Phi during rows declaration without assignment #6

@nelsam

Description

@nelsam

sqlrows panics when parsing the following code:

var rows *sql.Rows
if foo {
    rows, err = queryFoo()
} else {
    rows, err = queryBar()
}
if err != nil { return err }
defer rows.Close()

After digging in, it seems this is because var rows *sql.Rows comes in as an *ssa.Phi rather than 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