diff options
-rw-r--r-- | exercises/switch/switch2/main.go | 12 | ||||
-rw-r--r-- | info.toml | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/exercises/switch/switch2/main.go b/exercises/switch/switch2/main.go new file mode 100644 index 0000000..153ac39 --- /dev/null +++ b/exercises/switch/switch2/main.go @@ -0,0 +1,12 @@ +package main + +import "fmt" + +func main() { + switch { + case 0 > 1: + fmt.Println("zero is greater than one") + case: + fmt.Println("one is greater than zero") + } +} @@ -89,3 +89,10 @@ path = "exercises/switch/switch1/main.go" mode = "compile" hint = """ Switch flow is missing a variable to evaluate the statement.""" + +[[exercises]] +name = "switch2" +path = "exercises/switch/switch2/main.go" +mode = "compile" +hint = """ +Switch without a condition is possible, but that case statement needs a boolean evaluation.""" |