File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD
9
9
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 /go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0 =
10
10
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
11
11
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
12
+ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4 =
12
13
github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
13
14
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q =
14
15
github.com/stretchr/testify v1.3.0 /go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI =
Original file line number Diff line number Diff line change @@ -1075,6 +1075,11 @@ type stringModeNumberDecoder struct {
1075
1075
}
1076
1076
1077
1077
func (decoder * stringModeNumberDecoder ) Decode (ptr unsafe.Pointer , iter * Iterator ) {
1078
+ if iter .WhatIsNext () == NilValue {
1079
+ decoder .elemDecoder .Decode (ptr , iter )
1080
+ return
1081
+ }
1082
+
1078
1083
c := iter .nextToken ()
1079
1084
if c != '"' {
1080
1085
iter .ReportError ("stringModeNumberDecoder" , `expect ", but found ` + string ([]byte {c }))
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ func init() {
26
26
Field int `json:"field"`
27
27
})(nil ),
28
28
input : `{"field": null}` ,
29
+ }, unmarshalCase {
30
+ ptr : (* struct {
31
+ Field int `json:"field,string"`
32
+ })(nil ),
33
+ input : `{"field": null}` ,
29
34
}, unmarshalCase {
30
35
ptr : (* struct {
31
36
ID int `json:"id"`
You can’t perform that action at this time.
0 commit comments