Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
0240e182
Commit
0240e182
authored
Jun 09, 2017
by
eyalpost
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly handle multiple params with same type
parent
5e8312bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
parser.go
parser.go
+5
-4
No files found.
parser.go
View file @
0240e182
...
...
@@ -135,15 +135,16 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
func
buildMethodParams
(
funcParams
[]
*
ast
.
Field
,
pc
*
parsedComment
)
[]
*
param
.
MethodParam
{
result
:=
make
([]
*
param
.
MethodParam
,
0
,
len
(
funcParams
))
for
_
,
fparam
:=
range
funcParams
{
methodParam
:=
buildMethodParam
(
fparam
,
pc
)
result
=
append
(
result
,
methodParam
)
for
_
,
pName
:=
range
fparam
.
Names
{
methodParam
:=
buildMethodParam
(
fparam
,
pName
.
Name
,
pc
)
result
=
append
(
result
,
methodParam
)
}
}
return
result
}
func
buildMethodParam
(
fparam
*
ast
.
Field
,
pc
*
parsedComment
)
*
param
.
MethodParam
{
func
buildMethodParam
(
fparam
*
ast
.
Field
,
name
string
,
pc
*
parsedComment
)
*
param
.
MethodParam
{
options
:=
[]
param
.
MethodParamOption
{}
name
:=
fparam
.
Names
[
0
]
.
Name
if
cparam
,
ok
:=
pc
.
params
[
name
];
ok
{
//Build param from comment info
name
=
cparam
.
name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment