aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exp/sql
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2011-11-04 09:50:20 -0400
committerGustavo Niemeyer <gustavo@niemeyer.net>2011-11-04 09:50:20 -0400
commitf2dc50b48d011d4d585d09d5e6bed350894add3d (patch)
treea2f4d381dedf7ed00ffa2ac4c1ab9145ae032426 /src/pkg/exp/sql
parent39fcca60cb5a13d2836d5d92cf1ed9aea07f6366 (diff)
downloadgo-f2dc50b48d011d4d585d09d5e6bed350894add3d.tar.xz
html,bzip2,sql: rename Error methods that return error to Err
There are three classes of methods/functions called Error: a) The Error method in the just introduced error interface b) Error methods that create or report errors (http.Error, etc) c) Error methods that return errors previously associated with the receiver (Tokenizer.Error, rows.Error, etc). This CL introduces the convention that methods in case (c) should be named Err. The reasoning for the change is: - The change differentiates the two kinds of APIs based on names rather than just on signature, unloading Error a bit - Err is closer to the err variable name that is so commonly used with the intent of verifying an error - Err is shorter and thus more convenient to be used often on error verifications, such as in iterators following the convention of the sql package. R=bradfitz, rsc CC=golang-dev https://golang.org/cl/5327064
Diffstat (limited to 'src/pkg/exp/sql')
-rw-r--r--src/pkg/exp/sql/sql.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/exp/sql/sql.go b/src/pkg/exp/sql/sql.go
index 1af8e063cf..291af7f67d 100644
--- a/src/pkg/exp/sql/sql.go
+++ b/src/pkg/exp/sql/sql.go
@@ -620,7 +620,7 @@ func (s *Stmt) Close() error {
// err = rows.Scan(&id, &name)
// ...
// }
-// err = rows.Error() // get any Error encountered during iteration
+// err = rows.Err() // get any error encountered during iteration
// ...
type Rows struct {
db *DB
@@ -651,8 +651,8 @@ func (rs *Rows) Next() bool {
return rs.lasterr == nil
}
-// Error returns the error, if any, that was encountered during iteration.
-func (rs *Rows) Error() error {
+// Err returns the error, if any, that was encountered during iteration.
+func (rs *Rows) Err() error {
if rs.lasterr == io.EOF {
return nil
}