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
fc86f642
Commit
fc86f642
authored
Jul 15, 2017
by
shanfeng.yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sort ControllerComments
parent
cab8458c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
controller.go
controller.go
+6
-0
parser.go
parser.go
+1
-0
No files found.
controller.go
View file @
fc86f642
...
...
@@ -55,6 +55,12 @@ type ControllerComments struct {
MethodParams
[]
*
param
.
MethodParam
}
type
ControllerCommentsSlice
[]
ControllerComments
func
(
p
ControllerCommentsSlice
)
Len
()
int
{
return
len
(
p
)
}
func
(
p
ControllerCommentsSlice
)
Less
(
i
,
j
int
)
bool
{
return
p
[
i
]
.
Router
<
p
[
j
]
.
Router
}
func
(
p
ControllerCommentsSlice
)
Swap
(
i
,
j
int
)
{
p
[
i
],
p
[
j
]
=
p
[
j
],
p
[
i
]
}
// Controller defines some basic http request handler operations, such as
// http context, template and view, session and xsrf.
type
Controller
struct
{
...
...
parser.go
View file @
fc86f642
...
...
@@ -274,6 +274,7 @@ func genRouterCode(pkgRealpath string) {
sort
.
Strings
(
sortKey
)
for
_
,
k
:=
range
sortKey
{
cList
:=
genInfoList
[
k
]
sort
.
Sort
(
ControllerCommentsSlice
(
cList
))
for
_
,
c
:=
range
cList
{
allmethod
:=
"nil"
if
len
(
c
.
AllowHTTPMethods
)
>
0
{
...
...
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