Notice how there are no break statements, go will do this automatically for you at compilation stage, so there’s no need to include them.
There’s another keyword that we can use in switch statements, fallthrough , this will allow us for instance, to go to the first case, and it will continue to evaluate the next cases as well.
An example is below:
answer := 15switch {case answer%5 == 0:fmt.Println("It is divisible by 5")fallthroughcase answer%3 == 0:fmt.Println("It is divisible by 3")default:fmt.Println("The answer is neither divisible by 5 or 3")}