Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/json: unmarshal conversion of map with some invalid fields breaks valid fields #17425
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
Thanks for the answer; while I don't disagree that I should be catching the error the code I was originally working with had a composite struct with three properties and which correctly populated 2/3 fields in spite of the error.
Is the solution then to make sure you are only doing json unmarshal on a temporary structure that you can discard in the event of errors, or should an error prevent modifying the structure passed in?