Skip to content

Commit 57095ba

Browse files
committed
only check Go source files for non-thread-locked MakeGitError calls
1 parent 3087e61 commit 57095ba

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

script/check-MakeGitError-thread-lock.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"go/printer"
1010
"go/token"
1111
"log"
12+
"os"
13+
"path/filepath"
1214
"strings"
1315
)
1416

@@ -24,7 +26,7 @@ func main() {
2426
log.Fatal(err)
2527
}
2628

27-
pkgs, err := parser.ParseDir(fset, bpkg.Dir, nil, 0)
29+
pkgs, err := parser.ParseDir(fset, bpkg.Dir, func(fi os.FileInfo) bool { return filepath.Ext(fi.Name()) == ".go" }, 0)
2830
if err != nil {
2931
log.Fatal(err)
3032
}

0 commit comments

Comments
 (0)