mirror of
https://github.com/mgechev/revive.git
synced 2025-02-11 13:38:40 +02:00
fix lint issues (#1038)
This commit is contained in:
parent
259f22ea3f
commit
6b745b0075
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ vendor
|
|||||||
*.swp
|
*.swp
|
||||||
dist/
|
dist/
|
||||||
*.log
|
*.log
|
||||||
|
.idea
|
||||||
|
@ -188,7 +188,7 @@ func (f *File) disabledIntervals(rules []Rule, mustSpecifyDisableReason bool, fa
|
|||||||
enabledDisabledRulesMap[name] = existing
|
enabledDisabledRulesMap[name] = existing
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRules := func(filename, modifier string, isEnabled bool, line int, ruleNames []string) []DisabledInterval {
|
handleRules := func(_, modifier string, isEnabled bool, line int, ruleNames []string) []DisabledInterval {
|
||||||
var result []DisabledInterval
|
var result []DisabledInterval
|
||||||
for _, name := range ruleNames {
|
for _, name := range ruleNames {
|
||||||
if modifier == "line" {
|
if modifier == "line" {
|
||||||
|
@ -80,7 +80,7 @@ func (w lintFunctionForDataRaces) Visit(node ast.Node) ast.Visitor {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
getIds := func(exprs ...ast.Expr) []*ast.Ident {
|
getIDs := func(exprs ...ast.Expr) []*ast.Ident {
|
||||||
r := []*ast.Ident{}
|
r := []*ast.Ident{}
|
||||||
for _, expr := range exprs {
|
for _, expr := range exprs {
|
||||||
if id, ok := expr.(*ast.Ident); ok {
|
if id, ok := expr.(*ast.Ident); ok {
|
||||||
@ -90,7 +90,7 @@ func (w lintFunctionForDataRaces) Visit(node ast.Node) ast.Visitor {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
ids := getIds(n.Key, n.Value)
|
ids := getIDs(n.Key, n.Value)
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
w.rangeIDs[id.Obj] = struct{}{}
|
w.rangeIDs[id.Obj] = struct{}{}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user