tsenart / deadcode

Standalone repo of deadcode package from http://github.com/remyoudompheng/go-misc
Other
50 stars 15 forks source link

Why should deadcode analysis ignore tests? #2

Closed peterbourgon closed 8 years ago

peterbourgon commented 8 years ago

Consider this package.

Expected output: deadcode passes.

Actual output: deadcode: foo.go:3:1: bar is unused

bar is not unused; it's used in tests. Is that not good enough?

peterbourgon commented 8 years ago

To be clear, this is a question more than a real PR :) I'm sure there is a reason, I just can't think it up.