diff options
author | mattn <mattn.jp@gmail.com> | 2018-04-17 22:17:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 22:17:04 +0900 |
commit | 397c95cd5e2ee9c1d83ecf8160d9a0738c85b32a (patch) | |
tree | 7753bc98808cd0bdf408825396bc67a195c6a350 /sqlite3_test.go | |
parent | Merge pull request #546 from mattn/upgrade-3.23 (diff) | |
parent | fix small codespell issue (diff) | |
download | golite-397c95cd5e2ee9c1d83ecf8160d9a0738c85b32a.tar.gz golite-397c95cd5e2ee9c1d83ecf8160d9a0738c85b32a.tar.xz |
Merge pull request #549 from mjtrangoni/fix-linter-issues
Fix linter issues
Diffstat (limited to 'sqlite3_test.go')
-rw-r--r-- | sqlite3_test.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sqlite3_test.go b/sqlite3_test.go index 84ecb5a..782f57c 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -563,7 +563,7 @@ func TestBoolean(t *testing.T) { t.Fatalf("Expected 1 row but %v", counter) } - if id != 1 && fbool != true { + if id != 1 && !fbool { t.Fatalf("Value for id 1 should be %v, not %v", bool1, fbool) } @@ -585,7 +585,7 @@ func TestBoolean(t *testing.T) { t.Fatalf("Expected 1 row but %v", counter) } - if id != 2 && fbool != false { + if id != 2 && fbool { t.Fatalf("Value for id 2 should be %v, not %v", bool2, fbool) } @@ -1591,10 +1591,7 @@ func BenchmarkCustomFunctions(b *testing.B) { sql.Register("sqlite3_BenchmarkCustomFunctions", &SQLiteDriver{ ConnectHook: func(conn *SQLiteConn) error { // Impure function to force sqlite to reexecute it each time. - if err := conn.RegisterFunc("custom_add", customAdd, false); err != nil { - return err - } - return nil + return conn.RegisterFunc("custom_add", customAdd, false) }, }) }) @@ -1701,7 +1698,7 @@ func (db *TestDB) tearDown() { // q replaces ? parameters if needed func (db *TestDB) q(sql string) string { switch db.dialect { - case POSTGRESQL: // repace with $1, $2, .. + case POSTGRESQL: // replace with $1, $2, .. qrx := regexp.MustCompile(`\?`) n := 0 return qrx.ReplaceAllStringFunc(sql, func(string) string { |