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
6da4a66c
Commit
6da4a66c
authored
Dec 06, 2018
by
zav8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge switch cases
parent
5e4241fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
orm_raw.go
orm/orm_raw.go
+8
-18
No files found.
orm/orm_raw.go
View file @
6da4a66c
...
@@ -152,7 +152,7 @@ func (o *rawSet) setFieldValue(ind reflect.Value, value interface{}) {
...
@@ -152,7 +152,7 @@ func (o *rawSet) setFieldValue(ind reflect.Value, value interface{}) {
ind
.
Set
(
reflect
.
Zero
(
ind
.
Type
()))
ind
.
Set
(
reflect
.
Zero
(
ind
.
Type
()))
return
return
}
}
switch
ind
i
:=
ind
.
Interface
()
.
(
type
)
{
switch
ind
.
Interface
()
.
(
type
)
{
case
time
.
Time
:
case
time
.
Time
:
var
str
string
var
str
string
switch
d
:=
value
.
(
type
)
{
switch
d
:=
value
.
(
type
)
{
...
@@ -180,25 +180,15 @@ func (o *rawSet) setFieldValue(ind reflect.Value, value interface{}) {
...
@@ -180,25 +180,15 @@ func (o *rawSet) setFieldValue(ind reflect.Value, value interface{}) {
}
}
}
}
}
}
case
sql
.
NullString
:
case
sql
.
NullString
,
sql
.
NullInt64
,
sql
.
NullFloat64
,
sql
.
NullBool
:
err
:=
indi
.
Scan
(
value
)
indi
:=
reflect
.
New
(
ind
.
Type
())
.
Interface
()
if
err
==
nil
{
sc
,
ok
:=
indi
.
(
sql
.
Scanner
)
ind
.
Set
(
reflect
.
ValueOf
(
indi
))
if
!
ok
{
}
return
case
sql
.
NullInt64
:
err
:=
indi
.
Scan
(
value
)
if
err
==
nil
{
ind
.
Set
(
reflect
.
ValueOf
(
indi
))
}
case
sql
.
NullFloat64
:
err
:=
indi
.
Scan
(
value
)
if
err
==
nil
{
ind
.
Set
(
reflect
.
ValueOf
(
indi
))
}
}
case
sql
.
NullBool
:
err
:=
sc
.
Scan
(
value
)
err
:=
indi
.
Scan
(
value
)
if
err
==
nil
{
if
err
==
nil
{
ind
.
Set
(
reflect
.
ValueOf
(
indi
))
ind
.
Set
(
reflect
.
Indirect
(
reflect
.
ValueOf
(
sc
)
))
}
}
}
}
}
}
...
...
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