Skip to content

Commit

Permalink
fix: 不要な関数を消した
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho committed Sep 19, 2020
1 parent a372cda commit 888254f
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions wastedassign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 888254f

Please sign in to comment.