1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-13 18:24:39 +02:00

Merge pull request #1044 from thisiskevinchoi/patch-1

Add default case to switch statement in Go
This commit is contained in:
Levi Bostian
2015-04-21 11:01:32 -05:00

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.