On Fri, Aug 5, 2016 at 8:57 AM, dc0d <kaveh.shahbaz...@gmail.com> wrote:
> 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)

I don't think there is a reason as such.  I don't recall anybody ever
suggesting it.

Ian

-- 
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