Skip to content

Commit

Permalink
refactor(fixer.go): simplify file ignore logic using filepath.Match f…
Browse files Browse the repository at this point in the history
…or efficiency
  • Loading branch information
yyoshiki41 committed May 6, 2024
1 parent 5510fb4 commit 856f557
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ var (

func fix(filename, functionName string) error {
if p := *ignoreFileFlag; p != "" {
matches, err := filepath.Glob(p)
matched, err := filepath.Match(p, filename)
if err != nil {
return err
}
for _, match := range matches {
if match == filename {
return nil
}
if matched {
return nil
}
}

Expand Down

0 comments on commit 856f557

Please sign in to comment.