johnsonjh / jleveldb

jleveldb: JLevelDB is an implementation of the LevelDB key/value database in the Go programming language, based on GoLevelDB

Home Page:https://github.com/johnsonjh/jleveldb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(CRT-A0014) `switch` with single case can be rewritten as `if-else`

johnsonjh opened this issue · comments

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/

⚠️ This has been marked to be closed in 7 days.