common: simplify FileExist helper #32969#1871
common: simplify FileExist helper #32969#1871AnilChinchawale merged 1 commit intoXinFinOrg:dev-upgradefrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR simplifies the FileExist helper function by replacing a multi-line conditional statement with a single-line return statement using modern Go error checking patterns.
Key changes:
- Refactored
FileExistto useerrors.Is(err, fs.ErrNotExist)instead ofos.IsNotExist(err) - Consolidated logic from 5 lines to 1 line while maintaining identical behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes
simplify FileExist helper
Ref: ethereum#32969
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that