switch
with single case can be rewritten as if
or if-else
CRT-A0014switch
statements with a single case
can be rewritten as if-else
or if
.
Single case
switch
can be replaced by if-else
as it appears to be more
readable. This does not apply to type switch
.
switch ok {
case true:
// body
}
if ok {
// body
}