-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update README.md #3165
Update README.md #3165
Conversation
Missing a pointer reference when passing the context object in the route handler function. In Fiber, the context (c) is a pointer, so it should be *fiber.Ctx instead of fiber.Ctx.
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
WalkthroughThe changes in this pull request focus on updating the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/README.md (1)
Inconsistent Route Handler Signatures Across Documentation
The
.github/README.md
has been correctly updated to reflect the new route handler signatures. However, several other documentation files still use the outdatedfunc(c fiber.Ctx) error
orfunc(c *fiber.Ctx) error
patterns. To ensure consistency and avoid confusion for users, please update all markdown documentation files to use the updated route handler signatures.
- Update the following files:
docs/whats_new.md
docs/partials/routing/handler.md
docs/middleware/*.md
docs/intro.md
docs/guide/*.md
docs/api/*.md
binder/README.md
🔗 Analysis chain
Line range hint
1-2000
: Overall assessment of the README updateThe change made to the README.md file correctly addresses the issue described in the PR objectives. The update to the function signature in the example code ensures that users will use the correct type for the context parameter in their route handlers.
However, to maintain consistency throughout the documentation, it's recommended to review the entire README and any other documentation files to ensure that all examples and explanations reflect this change. This will help prevent any confusion for users who might encounter outdated information elsewhere in the documentation.
To ensure comprehensive documentation update, let's check for any other files that might contain similar code examples:
To ensure all markdown files are consistently updated with the correct Fiber route handler examples, let's run a revised shell script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for markdown files containing Fiber route handler examples fd -e md -x rg --type md 'func\(c (fiber\.Ctx|\*fiber\.Ctx)\) error' {}Length of output: 1035
Script:
#!/bin/bash # Search for markdown files containing Fiber route handler examples with correct context parameter fd -e md | xargs rg --no-heading 'func\(c \*?fiber\.Ctx\) error'Length of output: 15905
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/README.md (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
.github/README.md (1)
76-76
: Correct update to the context parameter type.The change from
func(c fiber.Ctx) error
tofunc(c *fiber.Ctx) error
accurately reflects the proper usage of the context object in Fiber v3. This modification ensures that the context is passed by reference, which is the correct way to handle it in the framework.To ensure consistency across the documentation, let's check for any other occurrences of the old signature:
#!/bin/bash # Search for any remaining instances of the old signature rg --type md 'func\(c fiber\.Ctx\) error' .github/README.md
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
@s19835 The context pointer is a Fiber v2 thing. For v3 which is what |
Missing a pointer reference when passing the context object in the route handler function. In Fiber, the context (c) is a pointer, so it should be *fiber.Ctx instead of fiber.Ctx.