style(p2p): changed if-else blocks to conform with golint #16660#2006
style(p2p): changed if-else blocks to conform with golint #16660#2006AnilChinchawale 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 refactors if-else blocks in the p2p package to conform with golint standards by removing unnecessary else blocks when the if branch contains a return statement. This follows the Go best practice of using early returns to reduce nesting.
Changes:
- Refactored
executeConnEventfunction inp2p/simulations/network.goto use early return pattern - Refactored
ExpectMsgfunction inp2p/message.goto use early return pattern
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| p2p/simulations/network.go | Removed unnecessary else block in executeConnEvent, using early return when connection is up |
| p2p/message.go | Removed unnecessary else block in ExpectMsg, using early return when content is nil |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes
Ref: ethereum#16660
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