You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-21 23:07:33 +02:00
fix build
This commit is contained in:
@ -384,6 +384,7 @@ type nonEmptyInterfaceCodec struct {
|
|||||||
func (codec *nonEmptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
func (codec *nonEmptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
|
||||||
if iter.WhatIsNext() == NilValue {
|
if iter.WhatIsNext() == NilValue {
|
||||||
iter.skipFourBytes('n', 'u', 'l', 'l')
|
iter.skipFourBytes('n', 'u', 'l', 'l')
|
||||||
|
*((*interface{})(ptr)) = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
nonEmptyInterface := (*nonEmptyInterface)(ptr)
|
nonEmptyInterface := (*nonEmptyInterface)(ptr)
|
||||||
|
@ -408,7 +408,7 @@ func Test_omitempty_nil_nonempty_interface(t *testing.T) {
|
|||||||
obj.Field = MyString("hello")
|
obj.Field = MyString("hello")
|
||||||
err = UnmarshalFromString(`{"field":null}`, &obj)
|
err = UnmarshalFromString(`{"field":null}`, &obj)
|
||||||
should.NoError(err)
|
should.NoError(err)
|
||||||
should.Equal(nil, obj.Field)
|
should.Nil(obj.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_marshal_nil_marshaler_interface(t *testing.T) {
|
func Test_marshal_nil_marshaler_interface(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user