logdel

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 15 Imported by: 0

README

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "logdel",
	Doc:  "logdel is ......",
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
}

Functions

func RunDeleteLog

func RunDeleteLog(pass *analysis.Pass, file *ast.File) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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