Skip to content
Prev Previous commit
Next Next commit
Linter updates.
  • Loading branch information
Scott Arbeit committed Apr 2, 2025
commit 5d3b4abf0a77081573e636daf9083d36e4ecc1ec
7 changes: 5 additions & 2 deletions sizes/dirsize.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ func CalculateGitDirSize(gitDir string) (counts.Count64, error) {

err := filepath.Walk(gitDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
// Skip files we can't access.
return nil
// Only skip errors for files we cannot access.
if os.IsNotExist(err) || os.IsPermission(err) {
return nil
}
return err
}

// Only count files, not directories.
Expand Down