Skip to content

Commit 6dad2de

Browse files
committed
fix build
1 parent 11c1cce commit 6dad2de

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

feature_reflect_native.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ type nonEmptyInterfaceCodec struct {
384384
func (codec *nonEmptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
385385
if iter.WhatIsNext() == NilValue {
386386
iter.skipFourBytes('n', 'u', 'l', 'l')
387+
*((*interface{})(ptr)) = nil
387388
return
388389
}
389390
nonEmptyInterface := (*nonEmptyInterface)(ptr)

jsoniter_interface_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func Test_omitempty_nil_nonempty_interface(t *testing.T) {
408408
obj.Field = MyString("hello")
409409
err = UnmarshalFromString(`{"field":null}`, &obj)
410410
should.NoError(err)
411-
should.Equal(nil, obj.Field)
411+
should.Nil(obj.Field)
412412
}
413413

414414
func Test_marshal_nil_marshaler_interface(t *testing.T) {

0 commit comments

Comments
 (0)