generate gocs support go buildin type in comment param

This commit is contained in:
tnextday 2016-08-18 17:38:26 +08:00
parent 11571b4af2
commit ac1bf161fc
1 changed files with 6 additions and 0 deletions

View File

@ -426,6 +426,12 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
if typ == "string" || typ == "number" || typ == "integer" || typ == "boolean" ||
typ == "array" || typ == "file" {
para.Type = typ
} else if sType, ok := basicTypes[typ]; ok {
typeFormat := strings.Split(sType, ":")
para.Type = typeFormat[0]
para.Format = typeFormat[1]
}else {
fmt.Fprintf(os.Stderr, "[%s.%s] Unknow param type: %s\n", controllerName, funcName, typ)
}
}
if len(p) > 4 {