1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-19 04:52:13 +02:00

Add default case to switch statement in Go

This commit is contained in:
Kev Choi
2015-04-20 23:26:38 -07:00
parent 4d1bc86b4e
commit f63032d2f2

View File

@@ -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.