From 083c3ee659c6c5542687f3bafae68cbc24dbc90f Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Sat, 25 Jun 2022 18:07:39 +0800 Subject: db: refactor "action" table to use GORM (#7054) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/dbtest/dbtest.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/dbtest') diff --git a/internal/dbtest/dbtest.go b/internal/dbtest/dbtest.go index 1183d732..353a2952 100644 --- a/internal/dbtest/dbtest.go +++ b/internal/dbtest/dbtest.go @@ -55,8 +55,8 @@ func NewDB(t *testing.T, suite string, tables ...interface{}) *gorm.DB { dbOpts.Name = dbName - cleanup = func(db *gorm.DB) { - db.Exec(fmt.Sprintf("DROP DATABASE `%s`", dbName)) + cleanup = func(_ *gorm.DB) { + _, _ = sqlDB.Exec(fmt.Sprintf("DROP DATABASE `%s`", dbName)) _ = sqlDB.Close() } case "postgres": @@ -86,8 +86,8 @@ func NewDB(t *testing.T, suite string, tables ...interface{}) *gorm.DB { dbOpts.Name = dbName - cleanup = func(db *gorm.DB) { - db.Exec(fmt.Sprintf(`DROP DATABASE %q`, dbName)) + cleanup = func(_ *gorm.DB) { + _, _ = sqlDB.Exec(fmt.Sprintf(`DROP DATABASE %q`, dbName)) _ = sqlDB.Close() } case "sqlite": -- cgit v1.2.3