Print warnning only if param location is wrong

This commit is contained in:
tnextday 2016-08-18 21:03:27 +08:00
parent 07df26c7b6
commit 2f85185bcc
1 changed files with 2 additions and 2 deletions

View File

@ -419,11 +419,11 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
case "formData":
fallthrough
case "body":
para.In = p[1]
break
default:
fmt.Fprintf(os.Stderr, "[%s.%s] Unknow param location: %s, Possible values are `query`, `header`, `path`, `formData` or `body`.\n", controllerName, funcName, p[1])
}
para.In = p[1]
pp := strings.Split(p[2], ".")
typ := pp[len(pp)-1]
if len(pp) >= 2 {