From 3008fb26a84c3f0815c3bc39a708438f5275d3d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Nieto?= <xiam@menteslibres.org>
Date: Wed, 15 May 2013 10:00:26 +0000
Subject: [PATCH] Updating example.
---
 README.md | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 8fdf70c7..8abb84ac 100644
--- a/README.md
+++ b/README.md
@@ -64,12 +64,20 @@ person := struct{
 }{}
 
 for {
-  // res.Next() will accept a pointer to map or struct.
+  // res.Next() accepts a pointer to map or a pointer to struct.
   err = res.Next(&person)
-  if err != nil {
+
+  if err == nil {
+    // If there is no error we can use person.
+    fmt.Printf("%v\n", person)
+  } else if err == db.ErrNoMoreRows {
+    // This error means we have read all rows.
     break
+  } else {
+    // Another kind of error needs proper management.
+    panic(err.Error())
   }
-  // fmt.Printf("%v\n", person)
+
 }
 ```
 
-- 
GitLab