-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func Locate() depth level #82
Comments
Keep in mind that each struct is its own map, so a struct containing other structs is turned into a map-of-maps. Consequently, the encoded msgpack looks like
You need to locate
|
If you wanted to be fancy, you could wrap |
Ok! It works... My bad, I made a mistake in my structure and I was looking for the wrong |
Mostly because the string-processing (allocation) is more expensive than the actual de-serialization, and so the performance benefit of incremental/partial processing goes out the window. |
Hi!
I'm trying to recover a slice of a byte array (encoded msgpack) .
The msgpacked string looks good and I'm able to recover a slice from the root depth, but not more.
Here is the structure:
I want to isolate
Field2
to decode it into aMyStructC
variable to avoid dealing with amap[string]interface{}
object since my fields are of typeinterface{}
.Using the
raw
content (the entire msgpack fromdata
) I can accessField1
and decode it to a proper structure but notField2
becausemsgp.Locate("Field2", raw)
returns an empty byte array.The text was updated successfully, but these errors were encountered: