Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/json: UnmarshalTypeError missing field & struct values #26444
What version of Go are you using (
@Gobd As far as I can tell, this is expected behaviour based on the implementation of the
In the playground example you provided it seems you have
I've made our two examples more similar, and they both get different behavior when ran in the playground.
Example 1 -- payloadField has field populated
Example 2 -- payloadNoField has field populated
So now in one example field only populates if the invalid value is first, then the reverse behavior occurs in the other example unless I'm missing something.