debugcode

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 3 Imported by: 0

README

debugcode

pkg.go.dev

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

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")
//}

Analyze with golang.org/x/tools/go/analysis

You can get analyzers of debugcode from debugcode.Analyzers. And you can use them with unitchecker.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
passes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL