1
0
mirror of https://github.com/beego/bee.git synced 2024-11-22 10:10:53 +00:00

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

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 {