On Fri, 2021-09-24 at 10:22 +0100, Ian Davis wrote:
> I was responding to your statement that it doesn't appear to use
> exact match in preference. It does, as the example I gave
> demonstrated. It's not about guarding case.
I'll clarify.
In the example I posted
https://play.golang.org/p/SQyE3R-GGNn, their is
clearly an assignment to a non-exact match despite an exact match being
present. In the example you posted, you show that this can be prevented
by providing another exactly matching field (this may not be what you
intended to show, but it does show that). This feature can be used to
prevent an incorrect assignment of the other-cased key-value like here
https://play.golang.org/p/Fk8CHy_v7Gg. This may be necessary if you
have incoming JSON that expects case to be considered and you don't
want/need of the cases in your deserialisation (this is what I mean by
case guarding).