Skip to content

Commit

Permalink
Don't prefix errors from os.Open with "error opening ...: "
Browse files Browse the repository at this point in the history
The standard library's
> open /this/does/not/exist: no such file or directory
might be sufficient.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Apr 17, 2023
1 parent f384c0d commit 9d0162f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tarball/tarball_src.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (r *tarballReference) NewImageSource(ctx context.Context, sys *types.System
} else {
file, err := os.Open(filename)
if err != nil {
return nil, fmt.Errorf("error opening %q for reading: %w", filename, err)
return nil, err
}
defer file.Close()
reader = file
Expand Down Expand Up @@ -213,7 +213,7 @@ func (is *tarballImageSource) GetBlob(ctx context.Context, blobinfo types.BlobIn
}
reader, err := os.Open(blob.filename)
if err != nil {
return nil, -1, fmt.Errorf("error opening %q: %v", blob.filename, err)
return nil, -1, err
}
return reader, blob.size, nil
}
Expand Down

0 comments on commit 9d0162f

Please sign in to comment.