mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-30 06:22:32 +03:00
Add default case to switch statement in Go
This commit is contained in:
parent
4d1bc86b4e
commit
f63032d2f2
@ -179,6 +179,8 @@ func learnFlowControl() {
|
|||||||
// Cases don't "fall through".
|
// Cases don't "fall through".
|
||||||
case 43:
|
case 43:
|
||||||
// Unreached.
|
// Unreached.
|
||||||
|
default:
|
||||||
|
// Default case is optional.
|
||||||
}
|
}
|
||||||
// Like if, for doesn't use parens either.
|
// Like if, for doesn't use parens either.
|
||||||
// Variables declared in for and if are local to their scope.
|
// Variables declared in for and if are local to their scope.
|
||||||
|
Loading…
Reference in New Issue
Block a user