Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: if referrer is nil #9

Open
tenntenn opened this issue Sep 13, 2021 · 2 comments
Open

panic: if referrer is nil #9

tenntenn opened this issue Sep 13, 2021 · 2 comments

Comments

@tenntenn
Copy link
Member

https://github.com/gostaticanalysis/sqlrows/blob/master/passes/sqlrows/sqlrows.go#L94
If refs is nil, *refs become a panic.

@jtorvald
Copy link
Contributor

Running into this as well. It would be helpful if it would not panic and say why or where this happens.

@jtorvald
Copy link
Contributor

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()
		}
	}()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants