1
0
mirror of https://github.com/json-iterator/go.git synced 2025-12-20 23:30:38 +02:00

move type declaration into separate files

This commit is contained in:
Tao Wen
2018-02-20 23:08:58 +08:00
parent b79587753b
commit 404d90796f
5 changed files with 61 additions and 110 deletions

View File

@@ -28,6 +28,7 @@ func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
*((*unsafe.Pointer)(ptr)) = nil
} else {
if *((*unsafe.Pointer)(ptr)) == nil {
// TODO: use reflect2 instead
//pointer to null, we have to allocate memory to hold the value
value := reflect.New(decoder.ValueType)
newPtr := extractInterface(value.Interface()).word