This is (old) documented issue https://github.com/golang/go/issues/460 
related to multiple values in one case of the switch.

On Sunday, June 26, 2016 at 5:40:55 PM UTC+2, Constantin Konstantinidis 
wrote:
>
> A part of the answer is in the specifications as the method set is 
> inherited from the type https://golang.org/ref/spec#Method_sets
>
>
> On Wednesday, June 22, 2016 at 12:02:02 AM UTC+2, raido...@gmail.com 
> wrote:
>>
>> 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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to