In Go we can write: if _, ok := input.(*data); ok { //... }
Why is it we can't do that in the case clause of a switch statement: switch { case x1,ok:=input.(*data1); ok && otherCond1: case x2,ok:=input.(*data2); ok && otherCond2: } (I've read the language specification - which BTW speaks about the "case expressions" - I'm just curious about the reason) -- 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.