Skip to content

Commit 6d165b5

Browse files
committed
chore: handle error while traversing the filesystem
1 parent 8bfcd01 commit 6d165b5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dev-tools/mage/common.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ func Tar(src string, targetFile string) error {
369369

370370
// walk through every file in the folder
371371
filepath.Walk(src, func(file string, fi os.FileInfo, errFn error) error {
372+
if errFn != nil {
373+
return fmt.Errorf("error traversing the file system: %w", errFn)
374+
}
375+
372376
// if a symlink, skip file
373377
if fi.Mode().Type() == os.ModeSymlink {
374378
fmt.Printf(">> skipping symlink: %s\n", file)

0 commit comments

Comments
 (0)