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
ae7e3171
Commit
ae7e3171
authored
Jul 28, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #112 from miraclesu/form
Refactor ParseForm
parents
29b1c8e1
fe7ecc37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
21 deletions
+3
-21
utils.go
utils.go
+3
-21
No files found.
utils.go
View file @
ae7e3171
...
...
@@ -206,37 +206,19 @@ func ParseForm(form url.Values, obj interface{}) error {
return
err
}
fieldV
.
SetBool
(
b
)
case
reflect
.
Int
:
fallthrough
case
reflect
.
Int8
:
fallthrough
case
reflect
.
Int16
:
fallthrough
case
reflect
.
Int32
:
fallthrough
case
reflect
.
Int64
:
case
reflect
.
Int
,
reflect
.
Int8
,
reflect
.
Int16
,
reflect
.
Int32
,
reflect
.
Int64
:
x
,
err
:=
strconv
.
ParseInt
(
value
,
10
,
64
)
if
err
!=
nil
{
return
err
}
fieldV
.
SetInt
(
x
)
case
reflect
.
Uint
:
fallthrough
case
reflect
.
Uint8
:
fallthrough
case
reflect
.
Uint16
:
fallthrough
case
reflect
.
Uint32
:
fallthrough
case
reflect
.
Uint64
:
case
reflect
.
Uint
,
reflect
.
Uint8
,
reflect
.
Uint16
,
reflect
.
Uint32
,
reflect
.
Uint64
:
x
,
err
:=
strconv
.
ParseUint
(
value
,
10
,
64
)
if
err
!=
nil
{
return
err
}
fieldV
.
SetUint
(
x
)
case
reflect
.
Float32
:
fallthrough
case
reflect
.
Float64
:
case
reflect
.
Float32
,
reflect
.
Float64
:
x
,
err
:=
strconv
.
ParseFloat
(
value
,
64
)
if
err
!=
nil
{
return
err
...
...
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