1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-16 02:22:15 +00:00

small fixes

This commit is contained in:
eyalpost
2017-04-25 23:42:35 +03:00
parent cbd831042a
commit 4cba78afd9
3 changed files with 23 additions and 25 deletions

View File

@@ -199,12 +199,11 @@ func parseComment(lines []*ast.Comment) (pc *parsedComment, err error) {
logs.Error("Invalid @Param format. Needs at least 4 parameters")
}
p := parsedParam{}
names := strings.Split(pv[0], "=")
funcParamName := names[0]
names := strings.SplitN(pv[0], "=>", 2)
p.name = names[0]
funcParamName := p.name
if len(names) > 1 {
p.name = names[1]
} else {
p.name = funcParamName
funcParamName = names[1]
}
p.location = pv[1]
p.datatype = pv[2]