Skip to content
Discussion options

You must be logged in to vote

Thank you for your report.

I wrote minimal code to reproduce the issue.
The input is Optional, but the return value is not. Therefore, it feels like the correct behavior for an error to occur when trying to unmarshal null into a non-Optional field.
https://go.dev/play/p/9WRLb5495cZ

The issue can be resolved by making the return value's field Optional, as shown below.
https://go.dev/play/p/Oc2r0DoiTYU

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rmillet-rs
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants