-
-
Notifications
You must be signed in to change notification settings - Fork 240
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 unmarshalling #10
Comments
Hi, thanks for the report. Blank string input shouldn't produce a null I think I will bump this up to v3 just in case people depend on the old behavior. |
Yep, this is an inconsistency I forgot to take care of when I made v2. I have fixed it and bumped the version up to v3. Thanks! Fixed in a9db3ac. |
You beat me to the PR! Thanks for fixing this. |
Unmarshalling and marshalling types in the
null
package isn't symmetric. For example:Why not have
in
unmarshal to{Name:{NullString:{String: Valid:true}}}
? In addition to clearing up the issue shown above it would make thenull
package incredibly useful for the common issue of how to determine if a RESTful request intends to set a value to the zero value or if it just wasn't included in the request (a PATCH-like request).Right now the common recommendation is to use pointers for the fields in your structs as described here, but I'd much prefer using the
null
package for this if I could.Let me know what you think. I'm happy to create a PR for this if you think this idea has legs.
The text was updated successfully, but these errors were encountered: