mirror of
https://github.com/json-iterator/go.git
synced 2024-11-27 08:30:57 +02:00
#76 fix UnmarshalJSON
This commit is contained in:
parent
82dabdcdbf
commit
08dbc98040
@ -267,6 +267,11 @@ func createDecoderOfType(cfg *frozenConfig, typ reflect.Type) (ValDecoder, error
|
||||
}
|
||||
return decoder, nil
|
||||
}
|
||||
if reflect.PtrTo(typ).ConvertibleTo(unmarshalerType) {
|
||||
templateInterface := reflect.New(typ).Interface()
|
||||
var decoder ValDecoder = &unmarshalerDecoder{extractInterface(templateInterface)}
|
||||
return decoder, nil
|
||||
}
|
||||
if typ.ConvertibleTo(anyType) {
|
||||
return &anyCodec{}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user