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) {
191191 stream .WriteRaw (string (rawMessage ))
192192 }
193193 }, func (ptr unsafe.Pointer ) bool {
194- return false
194+ return len ( * (( * json . RawMessage )( ptr ))) == 0
195195 }}
196196 extension [reflect2 .TypeOfPtr ((* json .RawMessage )(nil )).Elem ()] = encoder
197197 extension [reflect2 .TypeOfPtr ((* RawMessage )(nil )).Elem ()] = encoder
Original file line number Diff line number Diff line change 11package test
22
3- import "encoding/json"
3+ import (
4+ "encoding/json"
5+ )
46
57func init () {
68 marshalCases = append (marshalCases ,
79 json .RawMessage ("{}" ),
10+ selectedMarshalCase {struct {
11+ Env string `json:"env"`
12+ Extra json.RawMessage `json:"extra,omitempty"`
13+ }{
14+ Env : "jfdk" ,
15+ }},
816 )
917 unmarshalCases = append (unmarshalCases , unmarshalCase {
1018 ptr : (* json .RawMessage )(nil ),
You can’t perform that action at this time.
0 commit comments