Absolutely what I was going to say.
On Tue, Nov 27, 2018 at 6:32 AM Robert Engels wrote:
> Breaks backwards compatibility as the switch may already be in a for loop
> and using continue...
>
> On Nov 26, 2018, at 11:50 PM, Göcs Jëss wrote:
>
> We might as well reduce a one rarely used keyword
>
Breaks backwards compatibility as the switch may already be in a for loop and
using continue...
> On Nov 26, 2018, at 11:50 PM, Göcs Jëss wrote:
>
> We might as well reduce a one rarely used keyword
>
> continue means recommence or resume after interruption by google
>
> if a continue trigge
We might as well reduce a one rarely used keyword
continue means recommence or resume after interruption *by google*
if a continue triggers, the switch, select, or for loop statement *resumes*
another
case or condition
we could do continues inside switch statements
switch 1 {case 1:
cont
In addition, it just so happens that the break at the end situation is the most
common situation for a switch statement. So all Go did was flip the
requirements: instead of needing an explicit break to not fall through, have an
explicit fallthrough to not break.
The Go model of break by default
On Wed, 19 Oct 2016 18:47:03 +0300
Konstantin Khomoutov wrote:
[...]
> > Please, can you explain the follwing output:
[...]
> In addition to what Ian said, the way to understand how this works,
> is to compare it with how it works in C. In C, where the "classic"
> switch was implemented (and the
On Wed, 19 Oct 2016 06:27:47 -0700 (PDT)
hannover.p...@gmail.com wrote:
> Please, can you explain the follwing output:
>
> >4
> =5
> <4
>
> ---
>
> // Go 1.7.1
>
> package main
>
> import "fmt"
>
> func main() {
>x := 5
>
>switch {
>case x > 4:
> fmt.Pr
On Wed, Oct 19, 2016 at 6:27 AM, wrote:
> Please, can you explain the follwing output:
>
>>4
> =5
> <4
>
> ---
>
> // Go 1.7.1
>
> package main
>
> import "fmt"
>
> func main() {
>x := 5
>
>switch {
>case x > 4:
> fmt.Println(">4")
> fallthrough
Please, can you explain the follwing output:
>4
=5
<4
---
// Go 1.7.1
package main
import "fmt"
func main() {
x := 5
switch {
case x > 4:
fmt.Println(">4")
fallthrough
case x == 5:
fmt.Println("=5")
fallthrou