Skip to content

Commit 5d3b4ab

Browse files
author
Scott Arbeit
committed
Linter updates.
1 parent 56839e5 commit 5d3b4ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sizes/dirsize.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ func CalculateGitDirSize(gitDir string) (counts.Count64, error) {
1313

1414
err := filepath.Walk(gitDir, func(path string, info os.FileInfo, err error) error {
1515
if err != nil {
16-
// Skip files we can't access.
17-
return nil
16+
// Only skip errors for files we cannot access.
17+
if os.IsNotExist(err) || os.IsPermission(err) {
18+
return nil
19+
}
20+
return err
1821
}
1922

2023
// Only count files, not directories.

0 commit comments

Comments
 (0)