Skip to content
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

Revert "Update README.md (#3165)" #3166

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func main() {
app := fiber.New()

// Define a route for the GET method on the root path '/'
app.Get("/", func(c *fiber.Ctx) error {
app.Get("/", func(c fiber.Ctx) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update function signature in example code

The function signature in the example code has been updated from func(c *fiber.Ctx) error to func(c fiber.Ctx) error. This change removes the pointer to the fiber.Ctx type.

This change may have significant implications:

  1. It could potentially break existing code that relies on the pointer receiver.
  2. It might impact performance, as passing the context by value instead of by pointer could lead to unnecessary copying.
  3. It's inconsistent with the Fiber v2.x API, which uses pointer receivers for the context.

I recommend reverting this change or providing a clear explanation for why this change was made. If this is intentional, consider adding a note about the API change and its implications for users upgrading from previous versions.

-    app.Get("/", func(c fiber.Ctx) error {
+    app.Get("/", func(c *fiber.Ctx) error {
         // Send a string response to the client
         return c.SendString("Hello, World 👋!")
     })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
app.Get("/", func(c fiber.Ctx) error {
app.Get("/", func(c *fiber.Ctx) error {

// Send a string response to the client
return c.SendString("Hello, World 👋!")
})
Expand Down