summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKev Choi <kchoi@g.hmc.edu>2015-04-20 23:26:38 -0700
committerKev Choi <kchoi@g.hmc.edu>2015-04-20 23:26:38 -0700
commitf63032d2f216d62d149a8dc2f1df919999c41938 (patch)
treeb0507a0e21cb392c62a070c6bfb3a643f275dd46
parent4d1bc86b4e0ca6e64ccf480681b53afb06dbce6d (diff)
Add default case to switch statement in Go
-rw-r--r--go.html.markdown2
1 files changed, 2 insertions, 0 deletions
diff --git a/go.html.markdown b/go.html.markdown
index 17f10bd9..9b9758b4 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -179,6 +179,8 @@ func learnFlowControl() {
// Cases don't "fall through".
case 43:
// Unreached.
+ default:
+ // Default case is optional.
}
// Like if, for doesn't use parens either.
// Variables declared in for and if are local to their scope.