Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
styurin committed Jan 15, 2025
1 parent 82a64aa commit 283c8f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions warn/warn_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ func ruleLoadLocationWarning(f *build.File) []*LinterFinding {
continue
}

for i := 0; i < len(load.To); i++ {
for i := 0; i < len(load.From); i++ {
from := load.From[i]

expectedLocation, ok := tables.RuleLoadLocation[from.Name]
if !ok || expectedLocation == load.Module.Value {
continue
}

f := makeLinterFinding(load.From[i], fmt.Sprintf("Rule %q must be loaded from %v.", from.Name, expectedLocation))
f := makeLinterFinding(from, fmt.Sprintf("Rule %q must be loaded from %v.", from.Name, expectedLocation))
findings = append(findings, f)
}

Expand Down

0 comments on commit 283c8f9

Please sign in to comment.