Closed nightlord189 closed 3 months ago
Thanks for the report, I'll take a look
I can get a quick fix in but curious about one detail: at the moment it will always allocate the embedded struct during decoding, so:
User{Address: nil}
// decodes to:
User{Address: new(Address)}
Not sure how this used to work, maybe ideally it should only allocate if any of its members exist?
I checked an older version before the encoding changes and it has the same behavior, so I'll release the fix now. Will investigate further.
Yes, it was fixed. Thank you, @guregu!
In 1.22.3 if you try to save struct with nil pointer to anonymous struct you got error "panic: reflect: call of reflect.Value.Field on zero Value":