On Monday, November 6, 2017 at 8:03:28 PM UTC+2, Ian Lance Taylor wrote:
>
> On Mon, Nov 6, 2017 at 8:55 AM,  <dja...@gmail.com <javascript:>> wrote: 
> > 
> > Can someone explain, is this program  is really incorrect: 
> > https://play.golang.org/p/0fp9Nt_99L 
> > 
> > trying to run it results in error: 
> > tmp/sandbox536393528/main.go:16:9: goto C jumps into block starting at 
> > tmp/sandbox536393528/main.go:10:2 
> > but goto jumps in outside block. 
>
> Every case in a switch is an implicit block, so, yes, this program is 
> invalid and the compiler is telling you why. 
>

Thanks for clear explanation
 

>
> > I trying to make priority select by nesting selects, and want to find 
> way to 
> > write logic only in one place. 
>
> Use a function? 


Yes, i consider using functions, just wonder why goto does not work,

Thanks again.

Jamil Djadala



 

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