aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exercises/switch/switch2/main.go12
-rw-r--r--info.toml7
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")
+ }
+}
diff --git a/info.toml b/info.toml
index 5f74b98..0548505 100644
--- a/info.toml
+++ b/info.toml
@@ -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."""