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
It is kind of a bug in the library, which people might expect to work out of the box. But it is a missing feature.
You can take a look at how Set() and Get() are implemented to know why it's not working.
It is because the tmp_json is of type &Json{data:&Json{}} when it is supposed to be just &Json{}. EncodePretty works because the standard json library uses reflect (and does it correctly).
Two ways you can fix this in your code. (Workarounds)
By using parent.Set("child_1", child.Interface()) instead of parent.Set("child_1", child).
Or By using tmp_json.Interface().Get("foo").String()
The text was updated successfully, but these errors were encountered: