Feat: get file source route / Fix: cache initialize at wrong time

This commit is contained in:
HFO4
2019-12-10 11:55:28 +08:00
parent e871f6e421
commit 1963a495fb
6 changed files with 83 additions and 7 deletions

3
pkg/cache/driver.go vendored
View File

@@ -8,7 +8,8 @@ import (
// Store 缓存存储器
var Store Driver
func init() {
// Init 初始化缓存
func Init() {
//Store = NewRedisStore(10, "tcp", "127.0.0.1:6379", "", "0")
//return
if conf.RedisConfig.Server == "" || gin.Mode() == gin.TestMode {

View File

@@ -42,3 +42,11 @@ func TestSetSettings(t *testing.T) {
asserts.Equal("3", value1)
asserts.Equal("4", value2)
}
func TestInit(t *testing.T) {
asserts := assert.New(t)
asserts.NotPanics(func() {
Init()
})
}