diff --git a/cache/cache.go b/cache/cache.go index c6a9da47..26e40fa3 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -16,7 +16,7 @@ import ( // Cache interface contains all behaviors for cache adapter. // usage: // cache.Register("file",cache.NewFileCache()) // this operation is run in init method of file.go. -// c := cache.NewCache("file","{....}") +// c,err := cache.NewCache("file","{....}") // c.Put("key",value,3600) // v := c.Get("key") // diff --git a/parser.go b/parser.go index a4ae4d17..01df2c4a 100644 --- a/parser.go +++ b/parser.go @@ -158,6 +158,9 @@ func genRouterCode() { } func compareFile(pkgRealpath string) bool { + if !utils.FileExists(path.Join(workPath, "routers", "commentsRouter.go")) { + return true + } if utils.FileExists(path.Join(workPath, lastupdateFilename)) { content, err := ioutil.ReadFile(path.Join(workPath, lastupdateFilename)) if err != nil {