Feat: cache in-memory store

This commit is contained in:
HFO4 committed 2019-12-05 17:01:14 +08:00
1 parent 5d50e7ed1e
commit 7375cc01f1
8 files changed
+134 -26

No files matched your search

+2
View File
@@ -9,6 +9,7 @@ import (
)
var mock sqlmock.Sqlmock
var mockDB *gorm.DB
// TestMain 初始化数据库Mock
func TestMain(m *testing.M) {
@@ -19,6 +20,7 @@ func TestMain(m *testing.M) {
panic("An error was not expected when opening a stub database connection")
}
DB, _ = gorm.Open("mysql", db)
mockDB = DB
defer db.Close()
m.Run()
}