Skip to content

Commit def6729

Browse files
committed
fs: fix wrapping nil err
Signed-off-by: Akihiro Suda <[email protected]>
1 parent b17bab4 commit def6729

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/copy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
158158
}
159159
default:
160160
// TODO: Support pipes and sockets
161-
return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err)
161+
if err != nil {
162+
return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err)
163+
}
162164
}
163165

164166
if err := copyFileInfo(fi, source, target); err != nil {

0 commit comments

Comments
 (0)