You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an internal WithinArshalCall flag that the "json" implementation sets whenever calling a user-provided marshaler or unmarshaler. The purpose of this flag is as a sanity check that causes Encoder.Reset and Decoder.Reset to panic.
This check doesn't work for nested marshaler calls since inner call will clear the flag. We should either drop the check (since it's only as a sanity protection) or fix it such that it only clears the flag if it was able to set it in the first place.
There's an internal
WithinArshalCall
flag that the "json" implementation sets whenever calling a user-provided marshaler or unmarshaler. The purpose of this flag is as a sanity check that causesEncoder.Reset
andDecoder.Reset
to panic.This check doesn't work for nested marshaler calls since inner call will clear the flag. We should either drop the check (since it's only as a sanity protection) or fix it such that it only clears the flag if it was able to set it in the first place.
Thus instead of:
json/arshal_methods.go
Lines 195 to 197 in 60a0516
It'd be something like:
Overall, this is a pretty minor bug.
The text was updated successfully, but these errors were encountered: