Retrofitting with tests

This commit is contained in:
Deluan
2016-02-29 10:04:30 -05:00
parent ec9398f2bd
commit b0bd0a63a7
8 changed files with 2057 additions and 11 deletions
+8
View File
@@ -8,6 +8,7 @@ import (
)
var (
_ledisInstance *ledis.Ledis
_dbInstance *ledis.DB
once sync.Once
)
@@ -21,7 +22,14 @@ func db() *ledis.DB {
if err != nil {
panic(err)
}
_ledisInstance = l
_dbInstance = instance
})
return _dbInstance
}
func dropDb() {
db()
_ledisInstance.FlushAll()
}