Keyword

Go fallthrough keyword

Continues into the next textual case body of an expression switch without checking that case’s condition. It must be the final non-empty statement of a nonfinal clause; it is forbidden in type switches and select. Example prints basic then extras.

Formal Syntax & Structure

go syntaxgo
fallthrough

Working Example

Example Snippetgo
package main
import "fmt"
func main() {  switch 1 {  case 1:    fmt.Println("basic")    fallthrough  case 2:    fmt.Println("extras")  }}
Go Reference