Skip to content

📒 docs: fix invalid RouteChain method chaining example - #4304

Merged
ReneWerner87 merged 2 commits into
mainfrom
fix-invalid-go-method-chaining-in-documentation
May 21, 2026
Merged

ReneWerner87 merged 2 commits into
mainfrom
fix-invalid-go-method-chaining-in-documentation

Conversation

@gaby

@gaby gaby commented May 21, 2026

Copy link
Copy Markdown
Member

Motivation

  • Fix a documentation correctness bug in docs/whats_new.md where the RouteChain "After" example split method chaining before selector dots, producing invalid Go code due to automatic semicolon insertion.

Description

  • Adjust the RouteChain "After" example in docs/whats_new.md by 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.

@gaby
gaby requested a review from a team as a code owner May 21, 2026 02:54
Copilot AI review requested due to automatic review settings May 21, 2026 02:54
@gaby
gaby requested a review from sixcolors May 21, 2026 02:54
@gaby
gaby requested review from ReneWerner87 and efectn May 21, 2026 02:54
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2a9005f7-24be-4f76-9222-408d618beb53

📥 Commits

Reviewing files that changed from the base of the PR and between f7dceac and be39ecb.

📒 Files selected for processing (1)
  • docs/whats_new.md
✅ Files skipped from review due to trivial changes (1)
  • docs/whats_new.md

Walkthrough

The PR reformats a route-chaining code example in docs/whats_new.md: it breaks the chain after :id?, places .Get(...) and .Post(...) on separate leading-dot lines, and removes the trailing semicolon.

Changes

Route Chaining Example Formatting

Layer / File(s) Summary
Route Chaining example formatting
docs/whats_new.md
The "Route Chaining" migration guide code snippet is reformatted so the :id? segment ends with a dot, subsequent .Get(...) and .Post(...) calls are shown on separate chained lines, and the final semicolon is removed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • gofiber/fiber#3181: Updates route-chaining and migration documentation examples with related formatting changes.

Suggested labels

📒 Documentation, v3

Suggested reviewers

  • sixcolors
  • ReneWerner87
  • efectn

Poem

🐰 A tiny dot, a tidy line,
The chaining hops and looks divine.
No logic changed, just clearer art—
The docs now sing, a tiny part. 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides clear motivation and specific details about the fix, but does not follow the required template structure with sections like 'Changes introduced' or 'Type of change' checklists. Structure the description using the repository's template: add 'Changes introduced' section, select appropriate 'Type of change' (Documentation update), and complete the checklist items to align with contribution guidelines.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing an invalid Go method chaining example in documentation. It is specific, concise, and directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-invalid-go-method-chaining-in-documentation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread docs/whats_new.md
// After
app.RouteChain("/api").RouteChain("/user/:id?")
.Get(func(c fiber.Ctx) error {
app.RouteChain("/api").RouteChain("/user/:id?").

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This fix correctly addresses the syntax error caused by automatic semicolon insertion in Go. However, I noticed that the exact same invalid example exists earlier in this file at lines 397-398 (within the "Route chaining" section), which should also be updated for consistency and correctness.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 in docs/whats_new.md to 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.

Comment thread docs/whats_new.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gaby

gaby commented May 21, 2026

Copy link
Copy Markdown
Member Author

@copilot address all the open comments

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor

@copilot address all the open comments

The remaining review point is already addressed in be39ecb: the explicit semicolon was removed from the RouteChain example, and I verified the branch is clean after running the required checks.

Copilot finished work on behalf of gaby May 21, 2026 03:19
@ReneWerner87
ReneWerner87 merged commit 9b22c19 into main May 21, 2026
10 checks passed
@ReneWerner87
ReneWerner87 deleted the fix-invalid-go-method-chaining-in-documentation branch May 21, 2026 06:03
@github-project-automation github-project-automation Bot moved this to Done in v3 May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants