form v3.0.0 Release NotesRelease Date: 2017-07-31 // almost 4 years ago
- ➕ Added Embedded struct support
- ➕ Added
omitemptyjust like std lib JSON
Made a version bump to v3.0.0 because the new Embedded struct logic has the potential to affect existing clients.
0️⃣ The Encoder has a new option
SetAnonymousMode(...)by default it embeds anonymous struct info as if the fields were part of the containing struct itself; to continue to have it split out the Embedded structs just set mode to
AnonymousSeparateand it will function exactly as previous versions.
👀 please see examples detailing new functionality.
NOTE: if a struct and embedded struct have the same field, this will decode the value into both fields as there is no way to tell which you want; decoding into only the Embedded struct is still supported, again see examples.