Skip to content

Commit

Permalink
cpio: Wrap errors with %w
Browse files Browse the repository at this point in the history
This lets callers distinguish the type of error that occurred.

Signed-off-by: Ryan Gonzalez <[email protected]>
  • Loading branch information
refi64 authored and sjoerdsimons committed Jul 22, 2023
1 parent 3221840 commit f676b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpio/writerhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (w *WriterHelper) CopyFileTo(src, dst string) error {

f, err := os.Open(src)
if err != nil {
return fmt.Errorf("open failed: %s - %v", src, err)
return fmt.Errorf("open failed: %s - %w", src, err)
}
defer f.Close()

Expand Down

0 comments on commit f676b3a

Please sign in to comment.