diff --git a/retrieving.md b/retrieving.md index 33cee55..c16c0b6 100644 --- a/retrieving.md +++ b/retrieving.md @@ -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) }