Feat: cache in-memory store

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

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()
}