From f676b3ac365a1f14a1434283e4f65d13ad29a88c Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Mon, 23 Jan 2023 20:36:04 -0600 Subject: [PATCH] cpio: Wrap errors with %w This lets callers distinguish the type of error that occurred. Signed-off-by: Ryan Gonzalez --- cpio/writerhelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpio/writerhelper.go b/cpio/writerhelper.go index 72cce4d..eeef5d8 100644 --- a/cpio/writerhelper.go +++ b/cpio/writerhelper.go @@ -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()