Skip to content
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

Decoding nested map with integer keys #314

Open
rikvdh opened this issue Jun 30, 2021 · 0 comments
Open

Decoding nested map with integer keys #314

rikvdh opened this issue Jun 30, 2021 · 0 comments

Comments

@rikvdh
Copy link

rikvdh commented Jun 30, 2021

For my use-case I use nested maps with integers as keys (instead of strings as usual). For example this:

[129 5 133 0 169 49 50 55 46 48 46 48 46 49 1 165 58 51 51 51 52 64 203 63 185 153 153 153 153 153 154 65 203 63 185 153 153 153 153 153 154 66 1]

This is something encoded by this library. But I can't seem to decode this.

Expected Behavior

Decode without errors.

Current Behavior

msgpack: invalid code=0 decoding string/bytes length

Possible Solution

I don't know. I've tried 'SetMapDecoder' with UntypedMap, but this doesn't work as well.

Steps to Reproduce

https://play.golang.org/p/nOhguZK1vJo
or
https://play.golang.org/p/2RR-CfGQUAu

It appears that the sub-map (starting at the third byte) is decoded as a map[string]interface{}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant