1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 17:50:58 +00:00

fix the repeat commentsRouters

This commit is contained in:
astaxie 2014-11-06 16:25:47 +08:00
parent bb795847da
commit 1e92d17605

View File

@ -51,7 +51,6 @@ const COMMENTFL = "commentsRouter.go"
func init() { func init() {
pkgLastupdate = make(map[string]int64) pkgLastupdate = make(map[string]int64)
genInfoList = make(map[string][]ControllerComments)
} }
func parserPkg(pkgRealpath, pkgpath string) error { func parserPkg(pkgRealpath, pkgpath string) error {
@ -61,6 +60,7 @@ func parserPkg(pkgRealpath, pkgpath string) error {
Info(pkgRealpath + " don't has updated") Info(pkgRealpath + " don't has updated")
return nil return nil
} }
genInfoList = make(map[string][]ControllerComments)
fileSet := token.NewFileSet() fileSet := token.NewFileSet()
astPkgs, err := parser.ParseDir(fileSet, pkgRealpath, func(info os.FileInfo) bool { astPkgs, err := parser.ParseDir(fileSet, pkgRealpath, func(info os.FileInfo) bool {
name := info.Name() name := info.Name()