I have encountered some unexpected and inconsistent behavior with type 
switches. Can someone shed some light as to why Go behaves this way?

Take a look at https://play.golang.org/p/YPV5YPtWF8

I would expect both of the switches to behave the same way, but for some 
reason the one with multiple options in the case ends up with a pointer to 
an interface and the one with just one option ends up with a pointer to the 
correct type.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to