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

refactor: explicitly ignore errors that we don't need to handle #467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Feb 17, 2025

This enables the errcheck linter which enforces errors be either handled or explicitly ignored to make it clear that the error handling has been thought about rather than mistakenly forgotten.

Relates to #274

@G-Rath G-Rath mentioned this pull request Feb 17, 2025
46 tasks
@@ -544,7 +544,7 @@ func (i *ScanInput) GetRealPath() (string, error) {
return "", err
}
defer f.Close()
io.Copy(f, i.Reader)
_, _ = io.Copy(f, i.Reader)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this error should not be ignored

@@ -127,7 +127,7 @@ func readDir(fsys scalibrfs.FS, name string) (*dirIterator, error) {
if !ok {
// Fallback if ReadDirFile is not implemented: Use fs.DirFS's ReadDir().
// (Uses more memory since it reads all subdirs at once.)
file.Close()
_ = file.Close()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not be ignored.

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.

3 participants