From b76b90f75407f7656fcf45c646145992c9195f81 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Wed, 21 Nov 2018 11:14:40 +0100 Subject: [PATCH 1/3] Fix misspell issues. See, $ gometalinter --vendor --disable-all --enable=misspell ./... sqlite3.go:1379:45:warning: "succesfully" is a misspelling of "successfully" (misspell) sqlite3.go:1390:30:warning: "registerd" is a misspelling of "registered" (misspell) sqlite3_func_crypt.go:16:27:warning: "ceasar" is a misspelling of "caesar" (misspell) sqlite3_func_crypt.go:43:59:warning: "Ceasar" is a misspelling of "Caesar" (misspell) sqlite3_opt_userauth_test.go:450:27:warning: "succesful" is a misspelling of "successful" (misspell) sqlite3_opt_userauth_test.go:456:27:warning: "succesful" is a misspelling of "successful" (misspell) --- sqlite3.go | 4 ++-- sqlite3_func_crypt.go | 4 ++-- sqlite3_opt_userauth_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index d75e8b05..f2c20535 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -1376,7 +1376,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { // - Activate User Authentication // Check if the user wants to activate User Authentication. // If so then first create a temporary AuthConn to the database - // This is possible because we are already succesfully authenticated. + // This is possible because we are already successfully authenticated. // // - Check if `sqlite_user`` table exists // YES => Add the provided user from DSN as Admin User and @@ -1387,7 +1387,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { // Create connection to SQLite conn := &SQLiteConn{db: db, loc: loc, txlock: txlock} - // Password Cipher has to be registerd before authentication + // Password Cipher has to be registered before authentication if len(authCrypt) > 0 { switch strings.ToUpper(authCrypt) { case "SHA1": diff --git a/sqlite3_func_crypt.go b/sqlite3_func_crypt.go index d397c8cf..afd93333 100644 --- a/sqlite3_func_crypt.go +++ b/sqlite3_func_crypt.go @@ -13,7 +13,7 @@ import ( // This file provides several different implementations for the // default embedded sqlite_crypt function. -// This function is uses a ceasar-cypher by default +// This function is uses a caesar-cypher by default // and is used within the UserAuthentication module to encode // the password. // @@ -40,7 +40,7 @@ import ( // password X, sqlite_crypt(X,NULL) is run. A new random salt is selected // when the second argument is NULL. // -// The built-in version of of sqlite_crypt() uses a simple Ceasar-cypher +// The built-in version of of sqlite_crypt() uses a simple Caesar-cypher // which prevents passwords from being revealed by searching the raw database // for ASCII text, but is otherwise trivally broken. For better password // security, the database should be encrypted using the SQLite Encryption diff --git a/sqlite3_opt_userauth_test.go b/sqlite3_opt_userauth_test.go index b4ac4a92..df652152 100644 --- a/sqlite3_opt_userauth_test.go +++ b/sqlite3_opt_userauth_test.go @@ -447,13 +447,13 @@ func TestUserAuthModifyUser(t *testing.T) { t.Fatal(err) } if rv != SQLITE_AUTH { - t.Fatal("Password change succesful while not allowed") + t.Fatal("Password change successful while not allowed") } // Modify other user password and flag through *SQLiteConn err = c2.AuthUserChange("user2", "invalid", false) if err != ErrAdminRequired { - t.Fatal("Password change succesful while not allowed") + t.Fatal("Password change successful while not allowed") } } From c46327f585d68f71e75d2c5e707845afd5fd7df1 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Wed, 21 Nov 2018 11:21:52 +0100 Subject: [PATCH 2/3] sqlite3_test.go: Simplify return err --- sqlite3_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sqlite3_test.go b/sqlite3_test.go index b295ddd0..a67cf42b 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -1299,10 +1299,7 @@ func TestAggregatorRegistration(t *testing.T) { sql.Register("sqlite3_AggregatorRegistration", &SQLiteDriver{ ConnectHook: func(conn *SQLiteConn) error { - if err := conn.RegisterAggregator("customSum", customSum, true); err != nil { - return err - } - return nil + return conn.RegisterAggregator("customSum", customSum, true) }, }) db, err := sql.Open("sqlite3_AggregatorRegistration", ":memory:") From d2d0bf1bf1b780cd7cf73de96519d45f50bc47f9 Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Wed, 21 Nov 2018 11:28:08 +0100 Subject: [PATCH 3/3] upgrade/package.go: Fix golint issue --- upgrade/package.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/upgrade/package.go b/upgrade/package.go index 2b12a776..895bc739 100644 --- a/upgrade/package.go +++ b/upgrade/package.go @@ -1,6 +1,4 @@ -// Package upgrade -// -// Dummy to ensure package can be loaded +// Package upgrade is a dummy package to ensure package can be loaded // // This file is to avoid the following error: // can't load package: package go-sqlite3/upgrade: build constraints exclude all Go files in go-sqlite3\upgrade