From 8506194d2c887bb1b56fb639cb6c2da7a5c9d8df Mon Sep 17 00:00:00 2001 From: DennisMao Date: Fri, 25 Jan 2019 19:08:39 +0800 Subject: [PATCH] fix panic cause by the map --- cache/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/file.go b/cache/file.go index 691ce7cd..1926268a 100644 --- a/cache/file.go +++ b/cache/file.go @@ -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