From bbd31131a4264063eada8c32849f4eaae70eca7d Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 2 Aug 2014 10:11:45 +0800 Subject: [PATCH 1/2] beego:parse judge weather the commentsRouter exist --- parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser.go b/parser.go index f8818295..1356f6ae 100644 --- a/parser.go +++ b/parser.go @@ -159,6 +159,9 @@ func genRouterCode() { } func compareFile(pkgRealpath string) bool { + if !utils.FileExists(path.Join(AppPath, "routers", "commentsRouter.go")) { + return true + } if utils.FileExists(path.Join(AppPath, lastupdateFilename)) { content, err := ioutil.ReadFile(path.Join(AppPath, lastupdateFilename)) if err != nil { From 289f050c047112e7569082da0e93c7c49a86a5d4 Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 2 Aug 2014 10:12:03 +0800 Subject: [PATCH 2/2] cache: fix comments the return err --- cache/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/cache.go b/cache/cache.go index acb42043..fda5d8c3 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -17,7 +17,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") //