(CRT-A0014) `switch` with single case can be rewritten as `if-else`
johnsonjh opened this issue · comments
Jeffrey H. Johnson commented
Description
Single-statement switch
can be replaced by if-else
. For single statements, if-else
appears to be more readable. Example: go switch x := x.(type) { case int: body() }
should be written as: go if x, ok := x.(int); ok { body() }
Occurrences
There are 3 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/johnsonjh/jleveldb/issue/CRT-A0014/occurrences/
repo-ranger commented