-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Question regarding unmarshalReflect #124
Comments
Hello |
Either approach seems better than a panic 😄 It might be more idiomatic to match encoding/json's behavior, but the behavior should be explicitly documented either way. |
I released v1.7.1 which fixes this. I decided to return an error when the array is too small. I imagine most of the time unmarshaling into a too-small array is a mistake instead of intended behavior, and silently truncating data is scary. I can always change this later if there's demand for it. I haven't updated the docs yet but I'd like to have more explicit info about how each type is handled, I added this to #45. Thanks for the bug report! |
Whoops, forgot to include the fix for lists -> arrays in v1.7.1. |
Hi there, I'm currently running into an issue that I think may potentially be a bug, but wanted to get some background on the guarantees of
unmarshalReflect
(and the general premise of how this library performs unmarshaling). Inside of of theunmarshalReflect
'sreflect.Array
case, we have the following:How are you guaranteeing that
len(av.B)
is equal to (or less than)arr.Len()
?The text was updated successfully, but these errors were encountered: