brimdata / zed

A novel data lake based on super-structured data
https://zed.brimdata.io/
BSD 3-Clause "New" or "Revised" License
1.37k stars 67 forks source link

make unpack.Unmarshal consistent with json.Unmarshal #2702

Open mccanne opened 3 years ago

mccanne commented 3 years ago

Currently, unpack.Unmarshal() does not take an object on unmarshal into because it unmarshals into a generic map then builds the skeleton from the map. There is no reason the skeleton builder couldn't take a concrete object and recurse into it looking for empty interfaces as the means to create the skeleton. This would generalize unpacker nicely and make it consistent with json Unmarshal and it would give the opportunity to simplify the zjson decoder where it decodes typedefs by re-encoding each typedef back into JSON.

mccanne commented 1 year ago

Once fixed, zjsonio should be updated.