138
139 switch {
140 case len(password) == 6 && password[0] >= '0' && password[0] <= '9':
141 break142 case len(password) == 8:
143 scratch = true
144 default:
Redundant statements, like a break at the end of a case block, can be removed for improving the code's readability.
loop:
for {
switch a {
case 1:
a++
println("one")
break // unnecessary
case 2:
println("two")
break loop
default:
println("default")
}
}
loop:
for {
switch a {
case 1:
a++
println("one")
case 2:
println("two")
break loop
default:
println("default")
}
}