Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeCon: no need to wrap os.Write error #156

Merged
merged 1 commit into from Sep 9, 2021

Conversation

kolyshkin
Copy link
Collaborator

The errors returned from os are usually descriptive enough
(i.e. they contain the file name and the failed operation).

Fixes: bb3d708

The errors returned from os are usually descriptive enough
(i.e. they contain the file name and the failed operation).

Fixes: bb3d708
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Copy link
Collaborator

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 391 to 394
if err != nil {
return &os.PathError{Op: "write", Path: fpath, Err: err}
return err
}
return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised the linter didn't complain that this could just return err (which could be nil, or not).

I'm ok with the current version as the linter is ok with it (and it may be somewhat clearer)

@thaJeztah thaJeztah merged commit 6001286 into opencontainers:main Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants