-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Null values are unable to be processed in Iter #26
Comments
omitempty works best when you don't set the attributes instead of setting them to null. I think I can fix this issue though, thanks for the report. |
Awesome, I just haven't been able to find a way around the issue so I thought I would report it just in case it was an issue. Thank you! |
In the meantime, if you use a pointer for your int, like: type Widget struct {
Number *int `dynamo:"number"`
} it might help. However right now there is no way to encode a null value, it just gets omitted whether you specify omitempty or not, just like empty strings. This was kind of a personal preference. I think it's best to avoid using the null type in DynamoDB altogether but I understand that people may have preexisting data. Maybe I'll provide a way to configure this. |
It's hard to fix this easily with the current decoding code, but it's possible. I think this is worth fixing because of how the official encoding/decoding libraries work. See also #28. The origin of this bug is a difference of philosophies between AWS and me regarding empty strings. |
Error: dynamo: unmarshal int: expected N to be non-nil
using struct with
varname int
dynamo:"varname,omitempty"
Dynamo search shows "varname Null : true" when using "Iter.Next(&struct)"
I'm not finding a way to continue without this failing out.
The text was updated successfully, but these errors were encountered: