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

fix: close file #5632

Closed
wants to merge 1 commit into from
Closed

fix: close file #5632

wants to merge 1 commit into from

Conversation

testwill
Copy link

Description of your changes

Fixes #

I have:

Need help with this checklist? See the cheat sheet.

Signed-off-by: guangwu <[email protected]>
@testwill testwill requested review from phisco and a team as code owners April 26, 2024 10:18
@testwill testwill requested a review from turkenh April 26, 2024 10:18
@@ -228,6 +228,7 @@ func printFile(w io.Writer, path string) error {
if err != nil {
return errors.Wrapf(err, "failed to open file %s", path)
}
defer f.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

errcheck linter complains about unchecked errors, I think here it's safe to just ignore

Suggested change
defer f.Close()
//nolint:errcheck // We don't care about the error returned here.
defer f.Close()

@negz
Copy link
Member

negz commented May 20, 2024

It doesn't seem like @testwill will respond, closing this. I've raised #5717 to track.

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