Skip to content

Panic from vet #2933

Closed
Closed
@WillAbides

Description

@WillAbides

Version

1.23.0

What happened?

vet panics on error from db.PrepareContext. It runs s.Close() when s is nil.

sqlc/internal/cmd/vet.go

Lines 335 to 339 in df4c05b

func (p *dbPreparer) Prepare(ctx context.Context, name, query string) error {
s, err := p.db.PrepareContext(ctx, query)
s.Close()
return err
}

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions