From 7f271ef31b6c349172e27c32cccb7fefa0e35df1 Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Sat, 4 Dec 2021 18:08:11 +0800 Subject: [PATCH] test CallWithDB added --- test/base_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/base_test.go b/test/base_test.go index c3922ef81..d4024b97b 100644 --- a/test/base_test.go +++ b/test/base_test.go @@ -49,9 +49,7 @@ func TestBaseSqlDB(t *testing.T) { dbr = db.Model(&BarrierModel{}).Where("gid=?", "gid2").Find(&[]BarrierModel{}) asserts.Equal(dbr.RowsAffected, int64(0)) barrier.BarrierID = 0 - tx2, err := db.ToSQLDB().Begin() - asserts.Nil(err) - err = barrier.Call(tx2, func(tx *sql.Tx) error { + err = barrier.CallWithDB(db.ToSQLDB(), func(tx *sql.Tx) error { dtmimp.Logf("submit gid2") return nil })