-j
On Tue, Aug 1, 2017 at 2:34 PM Fumi Takeuchi <fmodqu...@gmail.com> wrote:
> Example code: https://play.golang.org/p/dVtPVt3oKt
>
> Maybe `fallthrough` statement cannot be used in `if` block even if it's put inside `swicth` block)
Fallthrough must be a design choice but goto's restriction is a necessity.What happens if you jump into the middle of an if block? You skipped the condition check, you run the code after the goto label, what about the code before the label, there might be some variables initialized, and how will you use this variables if you skip the initialization code.
Same applies to loops, furthermore, which iteration are you gonna be in?
> Maybe `fallthrough` statement cannot be used in `if` block even if it's put inside `swicth` block)