From ac1bf161fcbb3bd2b1fc6636111f6a0a16562aba Mon Sep 17 00:00:00 2001 From: tnextday Date: Thu, 18 Aug 2016 17:38:26 +0800 Subject: [PATCH] generate gocs support go buildin type in comment param --- g_docs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/g_docs.go b/g_docs.go index 005204d..a2b5ce5 100644 --- a/g_docs.go +++ b/g_docs.go @@ -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 {