aboutsummaryrefslogtreecommitdiff
path: root/internal/dbtest
diff options
context:
space:
mode:
authorJoe Chen <jc@unknwon.io>2022-06-25 18:07:39 +0800
committerGitHub <noreply@github.com>2022-06-25 18:07:39 +0800
commit083c3ee659c6c5542687f3bafae68cbc24dbc90f (patch)
tree0103bf3b5c5ebfccd368a7cb6a425a521fd669d9 /internal/dbtest
parent9df4e3ae3c555a86f691f0d78a43834842e77d8b (diff)
db: refactor "action" table to use GORM (#7054)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/dbtest')
-rw-r--r--internal/dbtest/dbtest.go8
1 files changed, 4 insertions, 4 deletions
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":