database/sql: *Rows.Err() does not return errors from *Rows.Scan() #25787
Labels
Milestone
Comments
CC @bradfitz @kardianos for SQL, @robpike for prose |
There is a change on master that may address this. Scan should return errs now if rows.lasterr == nil. |
Oh wait, you want the opposite. You would like Scan to store the scan error in lasterr if lasterr is nil so it can get reported in rows.Err(). |
Yep. It's not obvious that the phrase “during iteration” is intended to exclude |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not really advocating for the behavior to change, but the usage of the word "iteration" in the current documentation of
Rows.Err()
is ambiguous with respect to the behavior of*Rows.Scan()
. More examples and/or more precise documentation would help.What version of Go are you using (
go version
)?go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
https://play.golang.org/p/1xbP8gEMNtb
What did you expect to see?
(Given a certain reading of the
Rows.Err()
docs:)What did you see instead?
The text was updated successfully, but these errors were encountered: