File tree Expand file tree Collapse file tree 5 files changed +23
-16
lines changed Expand file tree Collapse file tree 5 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,13 @@ package jsoniter
2
2
3
3
import (
4
4
"github.com/modern-go/reflect2"
5
- "reflect"
6
5
"unsafe"
7
6
)
8
7
9
8
func decoderOfOptional (ctx * ctx , typ reflect2.Type ) ValDecoder {
10
9
ptrType := typ .(* reflect2.UnsafePtrType )
11
10
elemType := ptrType .Elem ()
12
11
decoder := decoderOfType (ctx , elemType )
13
- if ctx .prefix == "" && elemType .Kind () == reflect .Ptr {
14
- return & dereferenceDecoder {elemType , decoder }
15
- }
16
12
return & OptionalDecoder {elemType , decoder }
17
13
}
18
14
Original file line number Diff line number Diff line change
1
+ // +build !go1.14
2
+ // remove these tests temporarily until https://github.com/golang/go/issues/39105 is fixed
3
+
1
4
package test
2
5
3
6
import (
Original file line number Diff line number Diff line change @@ -121,10 +121,11 @@ func init() {
121
121
F1 int32 `json:"F1"`
122
122
F2 int32 `json:"F2,string"`
123
123
})(nil ),
124
- (* struct {
125
- F1 string `json:"F1"`
126
- F2 string `json:"F2,string"`
127
- })(nil ),
124
+ // remove temporarily until https://github.com/golang/go/issues/38126 is fixed
125
+ // (*struct {
126
+ // F1 string `json:"F1"`
127
+ // F2 string `json:"F2,string"`
128
+ // })(nil),
128
129
(* struct {
129
130
F1 uint8 `json:"F1"`
130
131
F2 uint8 `json:"F2,string"`
Original file line number Diff line number Diff line change
1
+ // +build go1.14
2
+
3
+ package test
4
+
5
+ func init () {
6
+ unmarshalCases = append (unmarshalCases , unmarshalCase {
7
+ obj : func () interface {} {
8
+ var i int
9
+ pi := & i
10
+ ppi := & pi
11
+ return & ppi
12
+ },
13
+ input : "null" ,
14
+ })
15
+ }
Original file line number Diff line number Diff line change @@ -27,13 +27,5 @@ func init() {
27
27
return & pi
28
28
},
29
29
input : "null" ,
30
- }, unmarshalCase {
31
- obj : func () interface {} {
32
- var i int
33
- pi := & i
34
- ppi := & pi
35
- return & ppi
36
- },
37
- input : "null" ,
38
30
})
39
31
}
You can’t perform that action at this time.
0 commit comments