1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-16 02:12:16 +00:00

Merge branch 'develop' of github.com:dvwallin/beego into develop

This commit is contained in:
David V. Wallin
2015-09-17 17:07:06 +02:00
56 changed files with 1571 additions and 995 deletions

View File

@@ -42,13 +42,13 @@ func init() {
`
var (
lastupdateFilename string = "lastupdate.tmp"
lastupdateFilename = "lastupdate.tmp"
commentFilename string
pkgLastupdate map[string]int64
genInfoList map[string][]ControllerComments
)
const COMMENTFL = "commentsRouter_"
const coomentPrefix = "commentsRouter_"
func init() {
pkgLastupdate = make(map[string]int64)
@@ -56,7 +56,7 @@ func init() {
func parserPkg(pkgRealpath, pkgpath string) error {
rep := strings.NewReplacer("/", "_", ".", "_")
commentFilename = COMMENTFL + rep.Replace(pkgpath) + ".go"
commentFilename = coomentPrefix + rep.Replace(pkgpath) + ".go"
if !compareFile(pkgRealpath) {
Info(pkgRealpath + " has not changed, not reloading")
return nil
@@ -132,9 +132,11 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
func genRouterCode() {
os.Mkdir(path.Join(workPath, "routers"), 0755)
Info("generate router from comments")
var globalinfo string
sortKey := make([]string, 0)
for k, _ := range genInfoList {
var (
globalinfo string
sortKey []string
)
for k := range genInfoList {
sortKey = append(sortKey, k)
}
sort.Strings(sortKey)