dive

dive
finds low readability if-blocks such as below.
- Too long if blocks
- Too many returns in a block
- A loop is in if-block
- Deeply nest
Install
You can get dive
by go install
command (Go 1.16 and higher).
$ go install github.com/gostaticanalysis/dive/cmd/dive@latest
How to use
dive
run with go vet
as below when Go is 1.12 and higher.
$ go vet -vettool=$(which dive) ./...
You can use dive.Analyzer with unitchecker.