On Fri, 2021-09-24 at 11:21 +0100, Ian Davis wrote: > This is not a correct interpretation. In your example the > unmarshaller reads the incoming json. The first key encountered is > "Name" and it matches exactly with the field named and tagged as Name > so that field is assigned the value. The next json key encountered is > "name" which does not match any field exactly so the unmarshaller > falls back to a case insensitive match and assigns the value to the > Name field, overwriting the previous value. > > Both the exact match and the case insensitive match are performed in > this example. There is no "incorrect" assignment as you describe.
I guess this depends on what a person considers to be correct. If you are writing code to comply with the JSON-RPC spec ( https://www.jsonrpc.org/specification), then I'd say that this is an incorrect assignment. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a3df312fbb9c942b27df42898f702770dd820e97.camel%40kortschak.io.