From 882c1d1daa16c92a861633c564204602eb8cc6cb Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 27 Feb 2019 19:44:03 +0000 Subject: [PATCH] Fixed some typos --- query.go | 2 +- result_test.go | 6 +++--- rows.go | 4 ++-- sqlmock.go | 2 +- sqlmock_test.go | 8 ++++---- statement_test.go | 4 ++-- stubs_test.go | 1 - 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/query.go b/query.go index 8e05848..47d3796 100644 --- a/query.go +++ b/query.go @@ -15,7 +15,7 @@ func stripQuery(q string) (s string) { // QueryMatcher is an SQL query string matcher interface, // which can be used to customize validation of SQL query strings. -// As an exaple, external library could be used to build +// As an example, external library could be used to build // and validate SQL ast, columns selected. // // sqlmock can be customized to implement a different QueryMatcher diff --git a/result_test.go b/result_test.go index e0214c5..f4eb815 100644 --- a/result_test.go +++ b/result_test.go @@ -35,21 +35,21 @@ func TestShouldReturnValidSqlDriverResult(t *testing.T) { result := NewResult(1, 2) id, err := result.LastInsertId() if 1 != id { - t.Errorf("Expected last insert id to be 1, but got: %d", id) + t.Errorf("expected last insert id to be 1, but got: %d", id) } if err != nil { t.Errorf("expected no error, but got: %s", err) } affected, err := result.RowsAffected() if 2 != affected { - t.Errorf("Expected affected rows to be 2, but got: %d", affected) + t.Errorf("expected affected rows to be 2, but got: %d", affected) } if err != nil { t.Errorf("expected no error, but got: %s", err) } } -func TestShouldReturnErroeSqlDriverResult(t *testing.T) { +func TestShouldReturnErrorSqlDriverResult(t *testing.T) { result := NewErrorResult(fmt.Errorf("some error")) _, err := result.LastInsertId() if err == nil { diff --git a/rows.go b/rows.go index 0244bd4..d9fe95f 100644 --- a/rows.go +++ b/rows.go @@ -9,9 +9,9 @@ import ( ) // CSVColumnParser is a function which converts trimmed csv -// column string to a []byte representation. currently +// column string to a []byte representation. Currently // transforms NULL to nil -var CSVColumnParser = func(s string) []byte { +var CSVColumnParser = func(s string) []bytezzx { switch { case strings.ToLower(s) == "null": return nil diff --git a/sqlmock.go b/sqlmock.go index 609dafd..4896307 100644 --- a/sqlmock.go +++ b/sqlmock.go @@ -118,7 +118,7 @@ func (c *sqlmock) MatchExpectationsInOrder(b bool) { } // Close a mock database driver connection. It may or may not -// be called depending on the sircumstances, but if it is called +// be called depending on the circumstances, but if it is called // there must be an *ExpectedClose expectation satisfied. // meets http://golang.org/pkg/database/sql/driver/#Conn interface func (c *sqlmock) Close() error { diff --git a/sqlmock_test.go b/sqlmock_test.go index 11fd59a..522ea42 100644 --- a/sqlmock_test.go +++ b/sqlmock_test.go @@ -114,7 +114,7 @@ func TestMockQuery(t *testing.T) { defer func() { if er := rows.Close(); er != nil { - t.Error("Unexpected error while trying to close rows") + t.Error("unexpected error while trying to close rows") } }() @@ -167,7 +167,7 @@ func TestMockQueryTypes(t *testing.T) { } defer func() { if er := rows.Close(); er != nil { - t.Error("Unexpected error while trying to close rows") + t.Error("unexpected error while trying to close rows") } }() if !rows.Next() { @@ -615,7 +615,7 @@ func TestArgumentReflectValueTypeError(t *testing.T) { _, err = db.Query("SELECT * FROM sales WHERE x = ?", 5) if err == nil { - t.Error("Expected error, but got none") + t.Error("expected error, but got none") } } @@ -782,7 +782,7 @@ func TestEmptyRowSet(t *testing.T) { defer func() { if er := rows.Close(); er != nil { - t.Error("Unexpected error while trying to close rows") + t.Error("unexpected error while trying to close rows") } }() diff --git a/statement_test.go b/statement_test.go index f951f63..fc4c541 100644 --- a/statement_test.go +++ b/statement_test.go @@ -7,7 +7,7 @@ import ( "testing" ) -func TestExpectedPreparedStatemtCloseError(t *testing.T) { +func TestExpectedPreparedStatementCloseError(t *testing.T) { conn, mock, err := New() if err != nil { t.Fatal("failed to open sqlmock database:", err) @@ -28,6 +28,6 @@ func TestExpectedPreparedStatemtCloseError(t *testing.T) { } if err := stmt.Close(); err != want { - t.Fatalf("Got = %v, want = %v", err, want) + t.Fatalf("got = %v, want = %v", err, want) } } diff --git a/stubs_test.go b/stubs_test.go index fa38fb4..b35be2e 100644 --- a/stubs_test.go +++ b/stubs_test.go @@ -25,7 +25,6 @@ func (ni *NullInt) Scan(value interface{}) error { ni.Integer, ni.Valid = 0, false case int64: const maxUint = ^uint(0) - const minUint = 0 const maxInt = int(maxUint >> 1) const minInt = -maxInt - 1