debugcode
debugcode
finds debug codes.
- builtinprint: finds calling builtin
print
or println
.
- commentout: finds a commented out debug code without reason
Install
You can get debugcode
by go install
command (Go 1.16 and higher).
$ go install github.com/gostaticanalysis/debugcode@latest
How to use
debugcode
run with go vet
as below when Go is 1.12 and higher.
$ go vet -vettool=$(which debugcode) ./...
Analyzers
builtinprint
See: https://github.com/gostaticanalysis/builtinprint
commentout: finds a commented out debug code without reason.
package a
//func f() { // want "do not leave a commented out debug code without reason"
// panic("not implement")
//}
// with reason // OK
//func f() {
// panic("not implement")
//}
You can get analyzers of debugcode from debugcode.Analyzers.
And you can use them with unitchecker.