📒 docs: fix invalid RouteChain method chaining example - #4304
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThe PR reformats a route-chaining code example in docs/whats_new.md: it breaks the chain after ChangesRoute Chaining Example Formatting
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Code Review
This pull request corrects a Go syntax error in the documentation's code examples by moving method chaining dots to the end of lines, preventing unintended semicolon insertion. The reviewer identified that the same invalid code pattern exists in another section of the file and should also be updated for consistency.
| // After | ||
| app.RouteChain("/api").RouteChain("/user/:id?") | ||
| .Get(func(c fiber.Ctx) error { | ||
| app.RouteChain("/api").RouteChain("/user/:id?"). |
There was a problem hiding this comment.
There was a problem hiding this comment.
Pull request overview
Fixes a Go syntax correctness issue in the RouteChain documentation example by formatting the multi-line method chain to avoid Go’s automatic semicolon insertion breaking selector expressions.
Changes:
- Updates the
RouteChain“After” example indocs/whats_new.mdto place selector dots at the end of lines so the snippet is valid Go. - Preserves the documented behavior while making the example copy/paste-able.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot address all the open comments |
The remaining review point is already addressed in |
Motivation
docs/whats_new.mdwhere theRouteChain"After" example split method chaining before selector dots, producing invalid Go code due to automatic semicolon insertion.Description
RouteChain"After" example indocs/whats_new.mdby moving the selector dots to the end of the preceding lines so the multiline method chain is valid Go syntax while preserving the example behavior.