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

filesystem: refactor: use errors.Is instead of os.IsNotExist #2558

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

efectn
Copy link
Member

@efectn efectn commented Aug 5, 2023

Description

Suggested way by https://pkg.go.dev/os#IsNotExist
Explain the details for making this change. What existing problem does the pull request solve?

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@gaby
Copy link
Member

gaby commented Aug 5, 2023

So gopsutil, is only used by the monitor middleware. Thoughts on moving that to contrib and having it use upstream gopsutil?

@efectn
Copy link
Member Author

efectn commented Aug 5, 2023

So gopsutil, is only used by the monitor middleware. Thoughts on moving that to contrib and having it use upstream gopsutil?

I agree about that idea. It's bad idea to include latest gopsutil to go.mod because of it's heavy https://github.com/shirou/gopsutil/blob/master/go.mod. Also it's bad idea to vendor it due to it's unmaintainable and it's really old release, it might have some security issues.

On the other hand; it's breaking change, we should think a bit more on it. What do you think @ReneWerner87

@ReneWerner87 ReneWerner87 merged commit 9fbb961 into master Aug 6, 2023
@efectn efectn deleted the filesystem-refactor-err branch August 12, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants