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
8e90ddd5
Commit
8e90ddd5
authored
Jan 04, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from corburn/master
Refactor pprof.go to use switch instead of if/else
parents
aa4b66b9
0c85c14e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
pprof.go
pprof.go
+7
-7
No files found.
pprof.go
View file @
8e90ddd5
...
...
@@ -9,17 +9,17 @@ type ProfController struct {
}
func
(
this
*
ProfController
)
Get
()
{
ptype
:=
this
.
Ctx
.
Params
[
":pp"
]
if
ptype
==
""
{
switch
this
.
Ctx
.
Params
[
":pp"
]
{
default
:
pprof
.
Index
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
}
else
if
ptype
==
"cmdline"
{
case
""
:
pprof
.
Index
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
case
"cmdline"
:
pprof
.
Cmdline
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
}
else
if
ptype
==
"profile"
{
case
"profile"
:
pprof
.
Profile
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
}
else
if
ptype
==
"symbol"
{
case
"symbol"
:
pprof
.
Symbol
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
}
else
{
pprof
.
Index
(
this
.
Ctx
.
ResponseWriter
,
this
.
Ctx
.
Request
)
}
this
.
Ctx
.
ResponseWriter
.
WriteHeader
(
200
)
}
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