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). -- 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/b666cf4347575490fcaca33890a024d885102fa4.camel%40kortschak.io.