mirror of
https://github.com/mgechev/revive.git
synced 2025-01-22 03:38:47 +02:00
removes unused code
This commit is contained in:
parent
b43b33a4e6
commit
5939a81c8a
@ -2,7 +2,6 @@ package rule
|
||||
|
||||
import (
|
||||
"go/ast"
|
||||
"reflect"
|
||||
|
||||
"github.com/mgechev/revive/lint"
|
||||
)
|
||||
@ -73,21 +72,6 @@ func (w *lintIdenticalBranches) identicalBranches(branches []*ast.BlockStmt) boo
|
||||
return true
|
||||
}
|
||||
|
||||
func (w *lintIdenticalBranches) identicalBranches2(branches []*ast.BlockStmt) bool {
|
||||
if len(branches) < 2 {
|
||||
return false
|
||||
}
|
||||
|
||||
ref := branches[0]
|
||||
for i := 1; i < len(branches); i++ {
|
||||
if !reflect.DeepEqual(branches[i], ref) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (w lintIdenticalBranches) newFailure(node ast.Node, msg string) {
|
||||
w.onFailure(lint.Failure{
|
||||
Confidence: 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user