3 ms·
> But deserialization runs into a roadblock, because you cannot implement interfaces like json.Unmarshaler on an interface type. In addition to introducing the
by catlifeonmars 4y ago
> But deserialization runs into a roadblock, because you cannot implement interfaces like json.Unmarshaler on an interface type.
In addition to introducing the wrapper type, this could also be fixed by using a JSON decoder implementation that supports type/location hooks. In other words, this is more of a limitation of the custom unmarshaling mechanism chosen by the builtin encoding/json package.