Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Add code comment to ease understanding #105

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions retrieving.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ defer rows.Close()
for rows.Next() {
err := rows.Scan(&id, &name)
if err != nil {
// log.Fatal will exit the program, preventing the deferred call to rows.Close()
log.Fatal(err)
}
log.Println(id, name)
}
err = rows.Err()
if err != nil {
// log.Fatal will exit the program, preventing the deferred call to rows.Close()
log.Fatal(err)
}
</pre>
Expand Down