move generateCode.Run() to g.go

This commit is contained in:
ZhengYang 2014-08-01 16:04:09 +08:00
parent 6894c9bc55
commit 5a2394d76a
1 changed files with 12 additions and 13 deletions

View File

@ -103,7 +103,6 @@ var modelsList map[string]map[string]swagger.Model
var rootapi swagger.ResourceListing
func init() {
cmdGenerate.Run = generateCode
pkgCache = make(map[string]bool)
controllerComments = make(map[string]string)
importlist = make(map[string]string)
@ -638,8 +637,8 @@ func appendModels(cmpath, pkgpath, controllerName string, realTypes []string) {
if _, ok := modelsList[pkgpath+controllerName][p+realType]; ok {
continue
}
fmt.Printf(pkgpath+":"+controllerName+":"+cmpath+":"+realType+"\n")
_, _, mod, newRealTypes := getModel(p+realType)
fmt.Printf(pkgpath + ":" + controllerName + ":" + cmpath + ":" + realType + "\n")
_, _, mod, newRealTypes := getModel(p + realType)
modelsList[pkgpath+controllerName][p+realType] = mod
appendModels(cmpath, pkgpath, controllerName, newRealTypes)
}