mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 10:00:56 +00:00
fix panic cause by the map
This commit is contained in:
parent
d0c744ae6a
commit
8506194d2c
2
cache/file.go
vendored
2
cache/file.go
vendored
@ -65,7 +65,7 @@ func NewFileCache() Cache {
|
||||
// the config need to be like {CachePath:"/cache","FileSuffix":".bin","DirectoryLevel":2,"EmbedExpiry":0}
|
||||
func (fc *FileCache) StartAndGC(config string) error {
|
||||
|
||||
var cfg map[string]string
|
||||
cfg := make(map[string]string)
|
||||
json.Unmarshal([]byte(config), &cfg)
|
||||
if _, ok := cfg["CachePath"]; !ok {
|
||||
cfg["CachePath"] = FileCachePath
|
||||
|
Loading…
Reference in New Issue
Block a user