Golang: Switch-case does not fall through!

Unlike C/C++ switch-case statements, Golang switch case does not fall through. package main import ( "fmt" ) func main() { fmt.Print("Go runs on ") os := "darwin" switch os { case "darwin": case "linux": fmt.Println("Linux.") default: // freebsd, openbsd, // plan9, windows... fmt.Printf("%s.\n", os) } } The above code does not print anything! package main…

%d bloggers like this: