Skip to content

database/sql: *Rows.Err() does not return errors from *Rows.Scan() #25787

Open
@zombiezen

Description

@zombiezen

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:)

2018/06/07 10:24:45 Error from Scan(...): sql: Scan error on column index 0: sql/driver: couldn't convert 42 into type bool
2018/06/07 10:24:45 Error from Err(): sql: Scan error on column index 0: sql/driver: couldn't convert 42 into type bool

What did you see instead?

2018/06/07 10:24:45 Error from Scan(...): sql: Scan error on column index 0: sql/driver: couldn't convert 42 into type bool
2018/06/07 10:24:45 No error from Err()

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions