File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
191
191
stream .WriteRaw (string (rawMessage ))
192
192
}
193
193
}, func (ptr unsafe.Pointer ) bool {
194
- return false
194
+ return len ( * (( * json . RawMessage )( ptr ))) == 0
195
195
}}
196
196
extension [reflect2 .TypeOfPtr ((* json .RawMessage )(nil )).Elem ()] = encoder
197
197
extension [reflect2 .TypeOfPtr ((* RawMessage )(nil )).Elem ()] = encoder
Original file line number Diff line number Diff line change 1
1
package test
2
2
3
- import "encoding/json"
3
+ import (
4
+ "encoding/json"
5
+ )
4
6
5
7
func init () {
6
8
marshalCases = append (marshalCases ,
7
9
json .RawMessage ("{}" ),
10
+ selectedMarshalCase {struct {
11
+ Env string `json:"env"`
12
+ Extra json.RawMessage `json:"extra,omitempty"`
13
+ }{
14
+ Env : "jfdk" ,
15
+ }},
8
16
)
9
17
unmarshalCases = append (unmarshalCases , unmarshalCase {
10
18
ptr : (* json .RawMessage )(nil ),
You can’t perform that action at this time.
0 commit comments