update revive lint to latest commit (#12921)
* update revive lint to latest commit * make fmt * change import
This commit is contained in:
parent
63e8bdaf73
commit
1c3278c2fa
154 changed files with 5965 additions and 8502 deletions
4
vendor/golang.org/x/tools/internal/analysisinternal/analysis.go
generated
vendored
4
vendor/golang.org/x/tools/internal/analysisinternal/analysis.go
generated
vendored
|
@ -402,14 +402,14 @@ func equivalentTypes(want, got types.Type) bool {
|
|||
func FindBestMatch(pattern string, idents []*ast.Ident) ast.Expr {
|
||||
fuzz := fuzzy.NewMatcher(pattern)
|
||||
var bestFuzz ast.Expr
|
||||
highScore := float32(-1) // minimum score is -1 (no match)
|
||||
highScore := float32(0) // minimum score is 0 (no match)
|
||||
for _, ident := range idents {
|
||||
// TODO: Improve scoring algorithm.
|
||||
score := fuzz.Score(ident.Name)
|
||||
if score > highScore {
|
||||
highScore = score
|
||||
bestFuzz = ident
|
||||
} else if score == -1 {
|
||||
} else if score == 0 {
|
||||
// Order matters in the fuzzy matching algorithm. If we find no match
|
||||
// when matching the target to the identifier, try matching the identifier
|
||||
// to the target.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue