Hi All,
I've created a simple struct that wraps time.Time because I'd like to unmarshal it differently from JSON than the default. It works great.
However, when I pass a type alias of that struct to json.Marshal or json.Unmarshal, the MarshalJSON and UnmarshalJSON functions aren't invoked, despite both types conforming to the interfaces.
Here's the shortest example I could make.
I did find a workaround, in redeclaring the MarshalJSON/UnmarshalJSON on the aliased type, but I don't understand why this is necessary, and I'm hoping someone who understands the innards of this better than I do could enlighten me.
Thanks,
-- Marcin