Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gostnops
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
57721468
Commit
57721468
authored
Dec 09, 2020
by
李志信
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: delete unsued comment
parent
3ab7aac0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
parser.go
encoding/json/parser.go
+4
-14
No files found.
encoding/json/parser.go
View file @
57721468
...
...
@@ -98,17 +98,6 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va
jsp
.
subObjValueMap
[
string
(
key
)]
=
reflect
.
ValueOf
(
subObj
)
case
jsonparser
.
Array
:
// TODO slice parse
//newParser := newJSONStructParser()
//subObj := newParser.json2Struct(value)
//jsp.hessianRegisterPair = append(jsp.hessianRegisterPair, HessianRegisterPair{
// JavaClassName: getJavaClassName(subObj),
// Obj: subObj,
//})
//jsp.structFields = append(jsp.structFields, reflect.StructField{
// Name: string(key),
// Type: reflect.TypeOf(subObj),
//})
case
jsonparser
.
String
:
// normal struct parse
// "type@value"
arr
:=
strings
.
Split
(
string
(
value
),
"@"
)
...
...
@@ -129,7 +118,8 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va
case
"bool"
:
userDefinedType
=
reflect
.
TypeOf
(
false
)
default
:
log
.
Println
(
"warning: val"
,
string
(
value
),
" in json is not supported"
)
log
.
Printf
(
"error: dataType %s in json is not supported
\n
"
,
string
(
value
))
return
perrors
.
Errorf
(
"dataType %s in json is not supported"
,
string
(
value
))
}
if
len
(
arr
)
>
1
{
jsp
.
valueMap
[
string
(
key
)]
=
arr
[
1
]
...
...
@@ -139,7 +129,7 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va
Type
:
userDefinedType
,
})
default
:
log
.
Printf
(
"error: dataType %s in json is not supported"
,
string
(
value
))
log
.
Printf
(
"error: dataType %s in json is not supported
\n
"
,
string
(
value
))
return
perrors
.
Errorf
(
"dataType %s in json is not supported"
,
string
(
value
))
}
return
nil
...
...
@@ -191,7 +181,7 @@ func (jsp *jsonStructParser) json2Struct(jsonData []byte) interface{} {
v
.
Field
(
i
)
.
SetBool
(
true
)
}
default
:
log
.
Printf
(
"error: val %s in value is not supported"
,
valStr
)
log
.
Printf
(
"error: val %s in value is not supported
\n
"
,
valStr
)
return
perrors
.
Errorf
(
"val %s in value is not supported"
,
valStr
)
}
}
...
...
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