Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0c85c14e
authored
2013-01-03 23:19:13 -0700
by
Jason Travis
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refactor: use switch instead of if/else to select ProfController type
1 parent
aa4b66b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
pprof.go
pprof.go
View file @
0c85c14
...
...
@@ -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
Styling with
Markdown
is supported
Attach a file
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 post a comment