Skip to content

Commit 4b8ae07

Browse files
committed
Allow Rows.Err to be called before Close
It's only rarely useful, but now it is allowed. No change in actual behavior, just documentation. It already worked this way. #2388
1 parent b593d5a commit 4b8ae07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ type Rows interface {
2929
// to call Close after rows is already closed.
3030
Close()
3131

32-
// Err returns any error that occurred while reading. Err must only be called after the Rows is closed (either by
33-
// calling Close or by Next returning false). If it is called early it may return nil even if there was an error
34-
// executing the query.
32+
// Err returns any error that occurred while executing a query or reading its results. Err must be called after the
33+
// Rows is closed (either by calling Close or by Next returning false) to check if the query was successful. If it is
34+
// called before the Rows is closed it may return nil even if the query failed on the server.
3535
Err() error
3636

3737
// CommandTag returns the command tag from this query. It is only available after Rows is closed.

0 commit comments

Comments
 (0)