mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00: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".
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user