logdel
This oss is a tool to delete log.Println(), etc. written for debugging, etc.
Bug
When using this tool, all comment-outs go to the bottom of the file. Please use with this in mind.
Example
Before
package a
import (
"log"
)
func f() {
log.Println("nocheck") // nocheck:thislog
log.Println("delete")
log.Print("delete")
if 1 == 10 {
log.Println(11)
}
for i := 0; i < 2; i++ {
log.Println(1)
}
}
After
package a
import (
"log"
)
func f() {
log.Println("nocheck")
if 1 == 10 {
}
for i := 0; i < 2; i++ {
}
}
Install
go install "github.com/seipan/logdel/cmd/logdel"
Use
go vet -vettool=`which logdel` pkgname