github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/switch39.gno (about) 1 package main 2 3 import "fmt" 4 5 func main() { 6 switch true { 7 case false: 8 x := "dontcare" 9 fmt.Println(x) 10 panic("should not happen") 11 case true: 12 x := "apples" 13 y := "oranges" 14 fmt.Println(x, y) 15 default: 16 panic("strange case but ok") 17 } 18 } 19 20 // Output: 21 // apples oranges