From 888254f7b6696bdc6efd865679a7b388ba284648 Mon Sep 17 00:00:00 2001 From: sanposhiho Date: Sat, 19 Sep 2020 20:20:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E8=A6=81=E3=81=AA=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E6=B6=88=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wastedassign.go | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/wastedassign.go b/wastedassign.go index 5e63404..dcaf855 100644 --- a/wastedassign.go +++ b/wastedassign.go @@ -74,39 +74,6 @@ func run(pass *analysis.Pass) (interface{}, error) { return nil, nil } -func searchTypeSwitchStmt(bodyList []ast.Stmt) []token.Pos { - result := []token.Pos{} - - for _, l := range bodyList { - switch a := l.(type) { - case *ast.IfStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, re...) - case *ast.BlockStmt: - re := searchTypeSwitchStmt(a.List) - result = append(result, re...) - case *ast.SwitchStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, a.Pos()) - result = append(result, re...) - case *ast.TypeSwitchStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, re...) - case *ast.SelectStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, re...) - case *ast.ForStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, re...) - case *ast.RangeStmt: - re := searchTypeSwitchStmt(a.Body.List) - result = append(result, re...) - } - } - - return result -} - type wastedReason string const (